Markinhos
Markinhos

Reputation: 736

Border around li tag

Is there any way that the border in a li tag includes the number and not just the content?

Here is the jsfiddle of what I am trying to do: http://jsfiddle.net/Markinhos/VSnnd/8/

I want the border includes the number two.

Upvotes: 37

Views: 96797

Answers (3)

NullPoiиteя
NullPoiиteя

Reputation: 57312

you can do this by list-style-position: inside;

The list-style-position CSS property specifies the position of the marker box in the principal block box. :MDN

jsFiddle

Upvotes: 6

Rick Donohoe
Rick Donohoe

Reputation: 7271

list-style-position: inside;

is the CSS attribute your looking for, it will treat the list number as if it is inside the CSS box model.

Upvotes: 11

Giona
Giona

Reputation: 21114

Add list-style-position:inside;

.borderlist {
    list-style-position:inside;
    border: 1px solid black;
}

Upvotes: 56

Related Questions