开发者

How do I make a following div ignore the space that would have been behind it if its floated left?

Hoping that someone could help this is a really开发者_StackOverflow社区 simple css setting that I know exists I just cat remember it.

I have 3 divs (1,2 and 3). That are set to float left so they all flow one after the other on a page. They are all 20px wide. What I want to do is make div 3 ignore the 20px width that the div 2 would create. So that div 1 would start at (left=0), div 2 would start at (left=20) and div 3 would also start at (left=20 instead of left = 40).

The setting that im thinking of I would need to apply to div to to tell it to be essentially ignored.

I know this is possible I just cant remember how, its something to do with the way that you relatively postition it.

Any help much appreciated.

Regards Pete


div 3 { position: absolute; left: 20px; }

of course you will have to set position relative to the container div for all three divs

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜