-1

don't know why but background color doesn't work. It disappeared after i added float:right. Hope you can help me. Thank you!

body {
  margin: 0;
}

#wrapper {
  margin: auto;
  width: 920px;
}

#wrapper #menu {
  background-color: #B8B8B8;
}

#wrapper #menu ul {
  margin: 0;
  padding: 0;
}

#wrapper #menu ul li {
  display: inline;
}

#wrapper #menu ul li a {
  text-decoration: none;
  float: right;
  padding: 10px;
}
fuskie
  • 85
  • 6

1 Answers1

0

Having all your children , in this case all the -li- elements floated, will collapse the height of the parent, reason why you can't see your background.

You could fix this by either setting a specific height for your -ul or maybe using something like clearfix.

Pablo Rincon
  • 999
  • 10
  • 23