css - How do I remove the extra height in my <li>? -


i'm not sure how ask clearly, post code:

body {    background-color: #232026;    background-image: url('galaxy16cropped.jpg');    background-position: center top;    background-repeat: repeat-y;    background-size: 2000px;    background-attachment: fixed;    font-family: 'lato', 'arial', sans-serif;    color: #ffffff;    padding: 0px;    margin: 0px;    line-height: 1.5;  }  a:hover:not(.nav) {    background-color: yellow;  }  div.nav {    background-color: #232026;    width: 100%;    margin: 0px;    padding: 6px 0px 6px 0px;    height: 40px;  }  .nav li {    color: #ffffff;    display: inline;    list-style-type: none;    text-align: center;    text-transform: uppercase;    margin: 0px;  }  li.current {    background-color: #424242;  }  .nav li.current:hover {    background-color: #424242;  }  .nav a:hover {    background-color: #737373;  }  .nav {    color: #ffffff;    text-decoration: none;    display: inline-block;    border: none;    width: 140px;  }  .nav p {    color: #ffffff;    margin: 0px;    text-decoration: none;    display: inline-block;    width: 140px;  }  .content p {    text-align: justify;    margin-left: 10px;    margin-right: 10px;    max-width: 400px;  }  .container p {    text-align: justify;    margin-left: 10px;    margin-right: 10px;  }  div.bar {    margin: 0px;    width: 100%;    padding-top: 6px;    padding-bottom: 6px;    border-bottom: 1px solid #dbdbdb;    border-top: 1px solid #dbdbdb;    background-color: #424242;    opacity: 0.8;    text-align: center;  }  ul {    text-align: justify;    margin-left: 10px;    padding-left: 8px;    margin-right: 10px;  }  .body li {    font-size: 80%;    margin-bottom: 6px;  }  .body li:before {    content: "\25b7";    padding-right: 8px;  }
<div class="nav">    <img src="logotranspwhite.png" height="40px" style="float:left; margin-right:10px; margin-left:15px; border: none;">    <ul>      <li class="current">        <p>home</p>      </li>      <li><a href="about.html">about</a>      </li>      <li><a href="null">contact</a>      </li>      <li><a href="gallery.html">gallery</a>      </li>    </ul>  </div>

you can see hover background taller .current background. solved removing a:hover:not(.nav) near top of css. added not(.nav) try fix this, didn't help. i'd keep a:hover rest of page, can't out menu backgrounds.

i'm confused this! help!

you need add layout .nav li selector.

.nav li {   display: inline-block; } 

or can float it:

.nav li {   float: left; } 

Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -