mardi 26 juillet 2016

Set List Item (li) exactly in center of page

Here is my simple code:

<ul>
  <li>
    Home
  </li>
</ul>

with this css:

ul
{
    text-align: center;
    margin: 0;
    padding: 3vh;
    position: fixed;
    bottom: 0;
    width: 100%;
    background-color: #333;
    overflow: hidden;
    list-style-type: none;
}
li
{
    display: inline;
}

And "Home" dose not exactly in center of page. this is how it look like now(black line mean center of page):

enter image description here

How i can fix it to appear look like this(black line mean center of page):

enter image description here




Aucun commentaire:

Enregistrer un commentaire