Home >Web Front-end >CSS Tutorial >How Can I Control the Horizontal Spacing Between Bullets and List Items in CSS?
When utilizing ordered or unordered lists (
To address your query, the answer lies in utilizing a span element with relative positioning. Enclose the content within a span and apply the "left" property to adjust the spacing.
li span { position: relative; left: -10px; /* Adjust this value to control the spacing */ }
For instance, to create additional space before the text, you could implement the following:
<ul> <li><span>item 1</span></li> <li><span>item 2</span></li> <li><span>item 3</span></li> </ul>
This approach allows you to fine-tune the horizontal spacing between bullets and
The above is the detailed content of How Can I Control the Horizontal Spacing Between Bullets and List Items in CSS?. For more information, please follow other related articles on the PHP Chinese website!