0

I have a navigation bar with CSS & HTML but a little problem. I want to make all the area of the text (Homepage f.e.) darker, not only the text.

CSS:

#navi {
background: #008cba url(http://img3.wikia.nocookie.net/__cb20101125042233/habbo/en/images/7/7f/Frank.gif) no-       repeat;
background-position: 1272px -14px;
margin-left: -8px;
margin-right: -8px;
height: 43px;
}

a {
text-decoration: none;
color: white;
font-size: 16px;
}

ul {
list-style-type: none;
margin-top: -8px;
padding: 10px;
padding-left: 5px;
margin-left: -15px;
}

li {
display: inline;
margin-left: 15px;
font-size: 14px;
}

li:hover {
background-color: black;
}

How i can make the complety area of the text darker? -> https://i.stack.imgur.com/TRhCe.png

Thanks in advance.

Aarivex
  • 19
  • 6

1 Answers1

0

Refine your css a little bit, add height to li element, change it to inline-block and add line-height to a :)

* {
  margin: 0px;
}
#navi {
  background: #008cba url(http://img3.wikia.nocookie.net/__cb20101125042233/habbo/en/images/7/7f/Frank.gif) no-repeat;
  background-position: 1272px -14px;
  height: 43px;
}
a {
  text-decoration: none;
  color: white;
  font-size: 16px;
  line-height: 43px;
  padding: 0px 10px;
}
ul {
  list-style: none;
  padding: 0px;
  margin: 0px;
}
li {
  display: inline-block;
  margin-left: 15px;
  font-size: 14px;
  height: 43px;
}
li:hover {
  background-color: black;
}
<div id="navi">
  <ul>
    <li><a href="#">Home</a>
    </li>
    <li><a href="#">Home</a>
    </li>
    <li><a href="#">Home</a>
    </li>
    <li><a href="#">Home</a>
    </li>
  </ul>
</div>
Bojan Petkovski
  • 6,835
  • 1
  • 25
  • 34