html - CSS set li indent -
Searching for GoogleGrouping and Stack Overflow will not yield any results that I can recognize, I'm sorry if asked beforehand do it. .
I have dropped down the main menu that uses lists as its basis. The problem is, the lists are very detailed, and they do not indent enough when expanded. So, this is my problem! How can I create an indent amount on more lists via CSS?
A You can indent Update with the different effects, with By default, many browsers use Set, however, both Settings Examples of padding-left versus margin-left and how they can work on ul: ul dropdown menu, use
< Code> / * main level * / ul {margin-left: 10px; } / * Second level * / ul ul {margin-left: 15px; } / * Third level * / ul ul ul {margin-left: 20px; } / * And so on ... * /
li and (if applicable)
a
padding-left instead.
padding-left to set initial indentation. If you want to get rid of it, then
padding-left: 0px;
margin-left and
padding-left settings affect indentation of the list in different ways Specifically:
margin-left affects indentation outside the element's limit, while the difference between the inside of
padding-left element Affects range
Padding-left: 0; Leaves bullets of li hanging on the edge of the element's range (at least in chrome), which you may or may not want.
Comments
Post a Comment