how to move div elements in center code example
Example 1: how to center a div element
/*ADD MARGIN auto to left and right*/
.box1{
width:80%;
margin:0 auto;
}
Example 2: center element in div
/* html */
Centering with CSS
Text-Align Method
Margin Auto Method
Absolute Positioning Method
/* css */
h1,
h3 {
text-align: center;
}
.blue-square-container {
text-align: center;
}
.blue-square {
background-color: #0074D9;
width: 100px;
height: 100px;
display: inline-block;
}