Skip to content

Instantly share code, notes, and snippets.

@agustinpfs
Created May 30, 2020 01:45
Show Gist options
  • Save agustinpfs/dff5fe33d3982b578daf871d8f9f3d0f to your computer and use it in GitHub Desktop.
Save agustinpfs/dff5fe33d3982b578daf871d8f9f3d0f to your computer and use it in GitHub Desktop.
Box Model CSS
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>box-model</title>
<style>
.box1 {
background-color: plum;
margin: 10px;
padding: 10px;
width: 200px;
height: 200px;
box-sizing: border-box;
border: 10px blue solid;
display: inline-block;
}
.box2 {
background-color: plum;
margin: 10px;
padding: 10px;
width: 200px;
height: 200px;
box-sizing: content-box;
border: 10px blue solid;
display: inline-block;
}
</style>
</head>
<body>
<div class="box1">box-sizing: border-box</div>
<div class="box2">box-sizing: content-box</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment