Can you margins on an <ul>?

Can you add margins to an Unordered List <ul> ??


yes, you can

Had my style messed up.



Indeed, in most browsers an UL has margins by default, so you usually will need to modify them to avoid surprises.

Hence the use of resets; same for LI – some browsers pad the ul, some margin the li, some pad the li… can drive you nutters.

This comes up from time to time, and for some reason people have it in their head that tags like numbered headings, paragraphs and UL’s can’t accept certain values – it’s why you see this IDIOCY all the blasted time:

<div id="topNav">
  <ul id="topNavUL">

usually applying things to the DIV that could just as easily be applied to the UL since from a CSS standpoint a display:block container is a display:block container, regardless of what tag it is. ALL CSS values are SUPPOSED to be applicable with the same result to ALL elements. (something Mozilla and Microsoft still can’t wrap their heads around with their treatment of LEGEND, INPUT and TEXTAREA)