HTML (HTML5) Div Align Center

Div align center specifies the horizontal alignment of the content inside web site.

HTML Div Align Center

code:


<!DOCTYPE html>
<html>
<header>
<style>
.content {
background-color:silver;
}
.block {
width:50%;
height:200px;
background-color:red;
}
</style>
</header>
<body>
 <div class="content">
   <br>
   <div align="center">
    <div class="block">
     <p>BLOCK</p>
    </div>
  <br>
  </div>
</div>
</body>
</html>

result:


BLOCK

















Privacy Policy