D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
clhenrick
Full window
Github gist
mfa dt bootcamp web class css positioning example 6: stretching block elements using position absolute & offset
<!DOCTYPE html> <!-- Credit:These positioning examples are credited to Noah Stokes' blog post on A List Apart, CSS positioning 101: https://alistapart.com/article/css-positioning-101 --> <html> <head> <meta charset="utf-8"> <title>Boxes positioned absolute and streched out</title> <style> h1, h3 { z-index: 10; text-align: center; } div { z-index: -9; } #box_1 { position: absolute; top: 10px; right: 10px; bottom: 10px; left: 10px; background: #44accf; } #box_2 { position: absolute; top: 20px; right: 20px; bottom: 20px; left: 20px; background: #ff9c34; } </style> </head> <body> <h1>Two boxes positioned absolute and streched out</h1> <h3>The blue box has top, right, bottom, left set to 10px</h3> <h3>The orange box has top, right, bottom, left set to 20px</h3> <div id="box_1"></div> <div id="box_2"></div> </body> </html>