M
M
Meliborn2012-02-04 22:29:55
css
Meliborn, 2012-02-04 22:29:55

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.

image

Answer the question

In order to leave comments, you need to log in

5 answer(s)
N
no1, 2012-02-05
@no1

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")}

A
Assorium, 2012-02-05
@Assorium

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;
}

A
Anatoly, 2012-02-04
@taliban

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.

W
wise_gopher, 2012-02-04
@wise_gopher

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;
}

S
ShpuntiK, 2012-02-05
@ShpuntiK

No background, extra traffic is needed, just as it was already said to register the border, for more liveliness you can make them in different shades, then there will be a “hollow” effect.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question