Last active
December 11, 2015 21:58
-
-
Save laurelschwulst/4665981 to your computer and use it in GitHub Desktop.
css-positioning.html
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> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>Positioning</title> | |
<style> | |
body { | |
height: 5000px; | |
} | |
.box { | |
padding: 15px; | |
border: 5px solid black; | |
height: 200px; | |
width: 200px; | |
} | |
.position1 { | |
position: static; | |
background: pink; | |
} | |
.position2a { | |
position: relative; | |
background: cyan; | |
} | |
.position2b { | |
position: relative; | |
background: cyan; | |
left: 240px; | |
} | |
.position3 { | |
position: absolute; | |
bottom: 10px; | |
right: 10px; | |
background: lime; | |
} | |
.position4 { | |
position: fixed; | |
top: 10px; | |
right: 10px; | |
background: yellow; | |
} | |
</style> | |
</head> | |
<body> | |
<h1> | |
Positioning | |
</h1> | |
<div class="box position1"> | |
<h2>Position 1: Static</h2> | |
Lorum ut vid que volorero vendigni dus sinis dolupta tibercid molenda corro ma vent, cus aut maioreperit, totatet et hillo. | |
</div> | |
<div class="box position2a"> | |
<h2>Position 2a: Relative</h2> | |
Lorum ut vid que volorero vendigni dus sinis dolupta tibercid molenda corro ma vent, cus aut maioreperit, totatet et hillo. | |
</div> | |
<div class="box position2b"> | |
<h2>Position 2b: Relative</h2> | |
Lorum ut vid que volorero vendigni dus sinis dolupta tibercid molenda corro ma vent, cus aut maioreperit, totatet et hillo. | |
</div> | |
<div class="box position3"> | |
<h2>Position 3: Absolute</h2> | |
Lorum ut vid que volorero vendigni dus sinis dolupta tibercid molenda corro ma vent, cus aut maioreperit, totatet et hillo. | |
</div> | |
<div class="box position4"> | |
<h2>Position 4: Fixed</h2> | |
Lorum ut vid que volorero vendigni dus sinis dolupta tibercid molenda corro ma vent, cus aut maioreperit, totatet et hillo. | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment