0

I am trying to create a navigation with an image above each list item instead of an individual image per item. It looks fine when I am full screen but when I minimize the screen expecting the list items to stack nicely they stack over one another. Below is a list of my code:

#nav ul, #nav li {
list-style: none;
font-size: 1.2em;
text-transform:uppercase;
}

#nav ul li {
display: inline;
list-style-image: none;
list-style-position: outside;
list-style-type: none;
background: url(images/navico.jpg) no-repeat center;
padding-top: 50px;
padding-right: 4px;
padding-bottom: 0px;
padding-left: 6px;
}

This is a link to the page http://ecoairofswfl.com/Bush2/

4

2 回答 2

0

尝试这个,

#nav ul li {
  background: url("images/navico.jpg") no-repeat scroll center center transparent;
  display: block;
  float: left;
  list-style: none outside none;
  padding: 50px 4px 0 6px;
}

我将它们更改为块元素并将它们浮动到左侧;内联不能按预期使用堆叠。

于 2013-09-25T14:55:57.697 回答
0
Solution is
#nav ul li {
    display: inline-block;
    list-style-image: none;
    list-style-position: outside;
    list-style-type: none;
    background: url(images/navico.jpg) no-repeat center;
    padding-top: 50px;
    padding-right: 4px;
    padding-bottom: 0px;
    padding-left: 6px;
    }
于 2013-09-25T14:58:07.047 回答