Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can we give <div> within <li>

can we give div tag within un order list tag.............. it will be in this format

<li><div>blablabla</div></li>

Is it Possible

like image 800
Mubeen Avatar asked Jun 10 '10 05:06

Mubeen


2 Answers

There are a lot of people that say a division inside a list item is incorrect, but according to the W3C validator it is perfectly fine. You'll never catch me putting divisions inside a list item though. Lists are too malformed to be putting additional block-level elements inside them.

like image 110
animuson Avatar answered Sep 29 '22 00:09

animuson


Syntactically, if you are unsure about the nesting of elements, there are free tools that will tell you what, if anything, is wrong. For example:

http://validator.w3.org/

Whether or not it is semantically correct is another story. You might be suffering of divitis.

like image 23
Lauri Lehtinen Avatar answered Sep 29 '22 00:09

Lauri Lehtinen