| 123456789101112131415161718192021222324252627282930313233343536 |
- <!doctype html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>023 calc</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; }
- .after { background: #333333; color: #ffffff; height: 24px; margin-top: 8px; padding-left: 4px; }
- </style>
- </head>
- <body>
- <h1>023 · calc()</h1>
- <p>The red box must be 191 px wide in both panes (422px stage minus 20px).</p>
- <div class="pane">
- <div class="label">A: width: calc(50% - 20px)</div>
- <div class="stage">
- <div class="red" style="width: calc(50% - 20px)"></div>
- <div class="after">after</div>
- </div>
- </div>
- <div class="pane">
- <div class="label">B: width: 191px</div>
- <div class="stage">
- <div class="red" style="width: 191px"></div>
- <div class="after">after</div>
- </div>
- </div>
- </body>
- </html>
|