Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Border on <li></li> items including image styled bullets

Tags:

html

css

How can i put a border on a <li> item including the styled bullets.

li{
   border:solid 1px gray;
}

CSS rule above will only give a border to the text contents of <li></li> and the border is not extended to the bullets which I have styled as png icons.

How can i get the bottom border on each li to extend to the list bullets as in the second screenshot?

Current Output

enter image description here

Desired Output enter image description here

like image 673
Lukesoft Avatar asked May 18 '15 08:05

Lukesoft


Video Answer


3 Answers

Like so:

ul {
    list-style-position: inside;
}

Your bullet is by default outside the <li> element.

like image 130
Bluety Avatar answered Oct 19 '22 23:10

Bluety


Add list-style-position : inside to the ul. Here... https://jsfiddle.net/dzrcL79o/

like image 24
Praveen Puglia Avatar answered Oct 20 '22 00:10

Praveen Puglia


Add

ul {
    border: 1px dashed gray;
    font-family: Arial, Tahoma, Verdana;
    list-style-position: inside;
}

li {
    border-bottom: 1px solid gray;
}
like image 1
Ikerepc Avatar answered Oct 20 '22 01:10

Ikerepc