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

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

Nuget pack csproj using nuspec -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -