Reputation: 736
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
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
Upvotes: 6
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
Reputation: 21114
Add list-style-position:inside;
.borderlist {
list-style-position:inside;
border: 1px solid black;
}
Upvotes: 56