samedi 30 août 2014

How to center with margin attribute


Vote count:

0




I am trying to center the to the middle of the page. To do so, I am using the margin: 0 auto; attribute. However, it isn't working. Any ideas?


HTML



<body>

<header id="navHead">
<div id="nav">
<ul id="navLinks">
<li>Home</li>
<li>About Me</li>
<li>Assignments</li>
</ul>
</div>
</header>

</body>


Here is the CSS



#navLinks {
list-style: none;
display: inline-flex;
margin: 0px auto;
}

#nav li {
margin-right: 20px;
}

#navHead {
width: 100%;
height: 12%;
padding: 25px 0px;
margin: 0px auto;
background: red;

}

#nav {
width: 100%;
margin:
}


asked 41 secs ago







How to center
with margin attribute

Aucun commentaire:

Enregistrer un commentaire