Answer the question
In order to leave comments, you need to log in
Who makes a strip between items in a horizontal menu?
The bar is usually smaller than the block height. On stackoverflow, for example, the bar is made as a separate "|" character. Frankly, I also did this, but I always thought that this was not right and there were more rational ways. Now I'm leaning towards background-image.
Answer the question
In order to leave comments, you need to log in
if the task is to put a vertical line, then why load extra images?
ul li + li:before{content:"|"}
If it's important with the image, then:
ul li + li:before{content:url("line.png")}
Everything is much easier. example
ul {
padding:5px;
}
li {
display:inline;
border-left:1px solid #bbb;
padding:0 2px 0 4px;
}
li:first-child {
border:none;
}
I make it a border, and if you need a strip less than the height of the block, then you can make the nested blocks smaller than the outer one.
Yes, with bg-image:
ul.topNav li {
display: inline;
width: 10em;
height: 36px;
float:right;
padding-top:9px; margin:0px;
background-image: url(../images/header_divider.gif);
background-repeat:no-repeat;
background-position: top left;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question