Forum Moderators: not2easy
Just the same as I can't get a bottom margin to appear on the last list item.
It seems to only appear if the surrounding <ul> has padding
ul {
width: 200px;
background-color: red;
padding: 1px;
margin: 0;
}
li {
list-style-type: none;
margin-top: 1px;
background-color: yellow;
} [edited by: markwm at 8:00 pm (utc) on Mar. 15, 2007]
ul? And is this happening in all browsers? Just IE 6? Just Firefox 2?
If you want the entire list to have a top and bottom margin, you should set that at the <ul> level.
This is pretty correct - although in some contexts it won't work (e.g. bottom margins on absolutely positioned elements don't show...)
It almost sounds like a margin-collapsing problem, but there's 1px of padding on the
ul in the OP example...