Skip to content

Commit

Permalink
margin: auto
Browse files Browse the repository at this point in the history
  • Loading branch information
Li-YangZhong committed Feb 3, 2020
1 parent 428db4f commit 92a9df8
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions 022/horizontally-center.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Position Elements</title>
<style>
#box {
width: 200px;
height: 200px;
border: 2px solid red;
background: pink;
margin: 0px auto;
}

#box1 {
width: 300px;
height: 100px;
border: 2px solid blue;
background: green;
}
</style>
</head>
<body>
<div id="box"></div>
<div id="box1"></div>
</body>
</html>

0 comments on commit 92a9df8

Please sign in to comment.