Forked from toolmantim/IE7 negative margin float bug WTF.html
Created
May 2, 2009 09:46
-
-
Save lachlanhardy/105482 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html lang='en-US' xml:lang='en-US' xmlns='http://www.w3.org/1999/xhtml'> | |
<head> | |
<title>IE float bug</title> | |
<meta content='text/html; charset=utf-8' http-equiv='Content-Type' /> | |
<style type='text/css'> | |
body { | |
font-family: Helvetica, sans-serif; } | |
#container { | |
background: yellow; | |
margin: 50px auto; | |
width: 500px;} | |
#right1 { | |
background: blue; | |
float: right; | |
width: 200px; | |
position: relative; | |
right: -220px; | |
} | |
#right2 {background: green; | |
float: right; | |
width: 200px; | |
position: relative; | |
right: -640px; | |
} | |
#left { | |
background: #ccc; | |
border: 1px solid red; | |
padding: 0 10px; | |
} | |
</style> | |
<body> | |
<div id='container'> | |
<div id='right1'> | |
floaty 1 | |
</div> | |
<div id='right2'> | |
floaty 2 | |
</div> | |
<div id='left'> | |
<p> | |
<strong>The two elements on the left should appear after each other, not stacked on top. Also they should be 20px to the right of this element, not directly beside it.</strong> | |
</p> | |
</div> | |
</div> | |
</body> | |
</head> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment