Googling and searching stack overflow did not return any results that I could recognize, so forgive me if this has been asked before…
I have drop down main menu which uses lists as its basis. The problem is, the lists are very wide, and they do not indent far enough when expanded. So, this is my problem! How do I make the indent amount on lists larger via CSS?
to indent a
uldropdown menu, useYou can indent the
lis and (if applicable) theas (or whatever content elements you have) as well , each with differing effects.You could also use
padding-leftinstead ofmargin-left, again depending on the effect you want.Update
By default, many browsers use
padding-leftto set the initial indentation. If you want to get rid of that, setpadding-left: 0px;Still, both
margin-leftandpadding-leftsettings impact the indentation of lists in different ways. Specifically:margin-leftimpacts the indentation on the outside of the element’s border, whereaspadding-leftaffects the spacing on the inside of the element’s border. (Learn more about the CSS box model here)Setting
padding-left: 0;leaves the li’s bullet icons hanging over the edge of the element’s border (at least in Chrome), which may or may not be what you want.Examples of padding-left vs margin-left and how they can work together on ul: https://jsfiddle.net/daCrosby/bb7kj8cr/1/