I'd like to control how much horizontal space a bullet pushes its <li>
to the right in an <ol>
or <ul>
.
That is, instead of always having
* Some list text goes
here.
I'd like to be able to change that to be
* Some list text goes
here.
or
*Some list text goes
here.
I looked around but could only find instructions for shifting the entire block left or right, for example, http://www.alistapart.com/articles/taminglists/
Old question, but the :before pseudo element works well here.
It works really well and doesn't require many extra rules or html.
Cheers!
Using text-indent on li works best.
text-indent: -x px; will move the bullet closer to li and vice-versa.
Using relative on span the negative left might not work properly with older versions for IE. P.S- avoid giving positions as much as you can.
An unordered list starts with the ul tag. Each list item starts with the The list items will be marked with bullets (small black circles) by default:
Output:
The text-indent property specifies the indentation of the first line in a text-block.
Note: Negative values are allowed. The first line will be indented to the left if the value is negative.
You can use
ul li:before
and a background image, and assignposition: relative
andposition:absolute
to theli
andli:before
, respectively. This way you can create an image and position it wherever you want relative to the li.This should do it. Be sure to set your bullets to the outside. you can also use CSS pseudo elements if you can drop them in IE7 downward. I don't really recommend using pseudo elements for this kinda thing but it does work to control distance.
use
<span style="display: flex;">
inside each<li>
.