- This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
Viewing 7 posts - 1 through 7 (of 7 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Hi there,
I have a question regarding a specific use of the UL tag.
If you had something like this on a page:
Screenshot
Would you use an unordered list that houses a div tag inside the li?
Or would you just use div tags on their own?
What’s more semantic? I have no problem styling either way, but It’s just one thing that’s been playing on my mind. Practically there’s no real use for the ul here, but at the same time it is a list of things being displayed right?
So far i’ve always been using the first method, but I want to make sure i do it all 100% right..
Thanks
@cayoub88 – You wouldn’t need the div on the first markup.
Hey,
You couldn’t use the div tag inside li tag, if you use then it will give error in W3C validation.
So make one class for that and use img,h2 and p tag for that, so your structure becomes follows,
Let it try :)
Thanks for your comments guys. I didn’t realise I could use the first markup without the div (although it does validate @ketu).
So should i not use a ul tag? I’m just after what’s more semantic…
Done deal. Thank you guys.
Makes sense, thanks for the addition @wolfcry911 , I think it is a tough call but realistically both should work in a given situation. I’ve used the ul li div format on this page arabiansounds.com.au/prod.