I have a little question regarding html lists and CSS. I want to have a list (whit sublist) that looks like this (view the result by running the code at http://htmledit.squarefree.com/ ):
<style type="text/css"> ul { border: 0px solid #90bade; } li { list-style-type:none; border: 1px solid black; } .lv1 { margin:0px 0px 0px 10px; } </style> <ul> <li>One</li> <li class ="lv1">Sub</li> <li>One</li> </ul>
But I would prefer to use the html code for this list:
<ul> <li>One <ul> <li>Sub</li> </ul> </li> <li>One</li> </ul>
Unfortunately, I can't figure out how to style the second list with CSS so that it looks like the first. Does anyone know if this is possible only using CSS or do I need to make one big list and use classes (like in the first list) to get the desired layout?
Thank you in advance
source share