M
M
Mary Solar2015-10-02 14:42:05
css
Mary Solar, 2015-10-02 14:42:05

Border or text-decoration?

Hello! Can you please tell me how to arrange such a menu? visible to the naked eye. that there are two lines between the list elements - a dark one and a gray one:
From the layout:
cd7e0aab1e0b4dfa87757611a4ed9355.jpg
Mine:
442bbc37367a41c18cf9c95b470a41c1.jpg
a border would be perfect, if only that underline weren't so long. I'm starting to doubt.
Thank you for your help. Everyone is warm!

Answer the question

In order to leave comments, you need to log in

6 answer(s)
N
Nikita Musikhin, 2015-10-02
@jestoky

this is the border of the li tag, it just seems to me that there is a general padding on the sides for the entire menu as a whole

D
Dmitry Novikov, 2015-10-02
@dmitriy_novikov

padding on the parent of the menu, and whatever you want - even border, even background ... but not text-decoration. it's not meant for that.

V
Vitaly Inchin ☢, 2015-10-02
@In4in

We make a link inside li display: block; , a little padding-bottomand a border.
In this case, you need to add paddingthe list element itself on the sides.
--" ☼ Example ☼ "--

I
Ivanq, 2015-10-02
@Ivanq

https://jsfiddle.net/Ivanq/pp754pfw/4/

S
Sergey Goryachev, 2015-10-02
@webirus

I think you get the point https://jsfiddle.net/webirus/61ot84tf/10/
UPD: Fixed the link to Fidl, something glitched.
UPD2: Added links and so that the bottom padding is after the last element.

C
Cat Anton, 2015-10-02
@27cm

https://jsfiddle.net/h99hq106/

ul {
    padding: 1em;
}

ul li {
    border-bottom: 1px solid #0F0F0F;
}

ul li:last-child {
    border-bottom: none;
}

ul li + li {
    border-top: 1px solid #262626;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question