Hello all,
When we create our UI design of HTML page, and we want to put specific div at the center of the page, we can do that with the help of CSS (Cascading Style Sheet). we can set the width of the div to a certain pixel and set the margin attribute to 0 auto.
Here is the code packet :
In HTML:
<!DOCTYPE html>
<html>
<head>
<style>
.centerAlign{
width:80%;
margin:0 auto;
}
</style>
</head>
<body>
<div class="centerAlign">
// Some content
</div>
</body>
</html>
0 Comment(s)