4 ms·
?? Negative margin-top renders the same for me in every browser except IE6. This code renders a green rectangle border on top of its parent with negative margin
by metamemetics 16y ago
??
Negative margin-top renders the same for me in every browser except IE6. This code renders a green rectangle border on top of its parent with negative margin-top even though it's inside:
#main{background:#F00;height:128px;width:128px;margin:100px;}
#shift{background:#0F0;height:16px;width:128px;margin-top:-16px;float:left;}
<div id="main">
<div id="shift"></div>
</div>
Can you give some example code of your problem? Also why would you ever be combining float and position:fixed? To my knowledge, if you set position to absolute or fixed, float is automatically be computed as none.