Last active
August 29, 2015 14:21
Star
You must be signed in to star a gist
box-sizing samples
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>box-sizing samples</title> | |
<style> | |
body { | |
text-align: center; | |
} | |
.box { | |
border-style: solid; | |
border-width: 4px; | |
box-sizing: content-box; | |
height: 150px; | |
padding: 35px; | |
margin: 30px auto 0; | |
width: 300px; | |
} | |
.border-box { | |
box-sizing: border-box; | |
} | |
.padding-box { | |
box-sizing: padding-box; | |
} | |
</style> | |
</head> | |
<body> | |
<h1>box-sizing samples</h1> | |
<p> | |
<em>All boxes have the same width, padding in border.</em> | |
</p> | |
<div class="box content-box"> | |
box-sizing: <strong>content-box</strong> | |
</div> | |
<div class="box border-box"> | |
box-sizing: <strong>border-box</strong> | |
</div> | |
<div class="box padding-box"> | |
box-sizing: <strong>padding-box</strong> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment