Thursday, September 29, 2011

Floated items and side li tag margin collapse

Lots of discussion about top and bottom margin collapsing.  But I'm most often disoriented when I encounter a li near a floated image.  Typically the image is floated left, but I don't want or need to float what's surrounding it.  Most of the other elements look fine jammed up against the image margin.  Not the LI's.  I want them tucked in a bit more, but their margin starts at the beginning of the floated image, so usually there's no margin at all.

Here's a little fiddle to illuminate.

This fellow has the answer:

.entry-content li {
left: 50px;
position: relative;
}

No comments:

Post a Comment