html - Margin: auto does not work -


<!doctype html> <html>     <head>         <link type="text/css" rel="stylesheet" href="stylesheet.css"/>         <title>meriniuc răzvan - dumitru</title>     </head>     <body>         <div class="left"></div>         <div class="right"></div>         <div id="header">             <h3>                 cv             </h3>         </div>         <div id="footer"></div>      </body> </html>  .left {     border-radius: 10px;     background-color: green;     height: 310px;     width: 75px;     float: left;     margin-top: 65px; }  .right {     border-radius: 10px;     background-color: blue;     height: 310px;     width: 50px;     float: right;     margin-top: 65px; }  #header {     position: fixed;     height: 65px;     background-color: red;     width: 720px;     border-radius: 10px;     display: block;  }  #footer {     clear: both;     height: 65px;     width: 720px;     background-color: black;     border-radius: 10px; }  h3 {     margin: auto; } 

with "margin:auto" "margin:auto". without "margin:auto" without "margin:auto"

i learning html , css , have tried create cv page, header won't center. have read problem , general solution seems make header display block, still doesn't work. please explain why code not center header , offer possible solution? thank in advance!

use text-align: center; h3 tag contains text.

h3 {     text-align: center; } 

Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -