| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <!doctype html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>029 percentage floats</title>
- <style>
- html, body { margin: 0; padding: 0; background: #ffffff; color: #202020; }
- body { font-family: sans-serif; font-size: 13px; }
- h1 { font-size: 20px; margin: 10px 0 4px 10px; }
- p { margin: 0 0 10px 10px; }
- .pane { float: left; width: 440px; margin-left: 10px; }
- .label { background: #eeeeee; padding: 4px 6px; margin-bottom: 4px; }
- .stage { background: #ffffff; padding: 8px; border: 1px solid #999999; }
- .red { background: #cc3333; height: 40px; }
- .blue { background: #2244cc; height: 40px; }
- .after { background: #333333; color: #ffffff; height: 24px; margin-top: 8px; padding-left: 4px; }
- </style>
- </head>
- <body>
- <h1>029 · percentage floats</h1>
- <p>Each pane must show two 50% columns side by side.</p>
- <div class="pane">
- <div class="label">A: float: left; width: 50%</div>
- <div class="stage">
- <div class="red" style="float: left; width: 50%"></div>
- <div class="blue" style="float: left; width: 50%"></div>
- <div class="after">after</div>
- </div>
- </div>
- <div class="pane">
- <div class="label">B: absolute 200px reference</div>
- <div class="stage">
- <div style="position: relative; height: 40px">
- <div class="red" style="position: absolute; left: 0; top: 0; width: 200px; height: 40px"></div>
- <div class="blue" style="position: absolute; left: 200px; top: 0; width: 200px; height: 40px"></div>
- </div>
- <div class="after">after</div>
- </div>
- </div>
- </body>
- </html>
|