html - UL under LI inspite of block under Inline -
i have idea placing block under inline incorrect. while building tree structure use ul
under li
. please explain why valid html?
the default display
value li
property not inline
, it's list-item
. , ul
designed nested in list, there's no problem placing ul
within li
.
furthermore, of html5, placing block elements inside inline elements valid html.
from mdn:
the distinction of block-level vs. inline elements used in html specifications 4.01. in html5, binary distinction replaced more complex set of content categories. "block-level" category corresponds category of flow content in html5, while "inline" corresponds phrasing content, there additional categories.
if, however, don't want put block element within inline element rendering or other reasons, have option change display
value:
<span style="display: block"> <div style="display: inline"> ... </div> </span>
Comments
Post a Comment