lachlanhardy (owner)

Revisions

gist: 105482 Download_button fork
public
Public Clone URL: git://gist.github.com/105482.git
Embed All Files: show embed
IE7 negative margin float bug WTF.html #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<!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>