Centering text inside header - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Header

Description

Centering text inside header

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">

#mainHeader {<!-- w  w w .  jav a2  s.  c om-->
   background-color: #282828;
   width: 100%;
   height: 100vh;
   text-align: center;
}
#hello {
   color: #f2f2f2;
   font-size: 200px;
   font-family: monospace;
   margin-bottom: 0;
   margin-top: 0;
}
#body {
   margin: 0;
}


      </style> 
 </head> 
 <body> 
  <header id="mainHeader"> 
   <p id="hello"> this is a test</p> 
  </header>  
 </body>
</html>

Related Tutorials