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 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 ... * /   

You can indent li and (if applicable) a

Update with the different effects, with margin-left You can use padding-left instead.

By default, many browsers use padding-left to set initial indentation. If you want to get rid of it, then padding-left: 0px;

Set, however, both 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

Settings 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.

Examples of padding-left versus margin-left and how they can work on ul:

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -