Home >Web Front-end >CSS Tutorial >How Can I Position a List-Style-Image?
Question:
Is there a way to adjust the position of the image used as the bullet point in a list (list-style-image)?
Answer:
No, directly adjusting the position of list-style-image is not possible. The reason is that padding applied to list items primarily affects the content within them, not the image.
Alternative Approach:
To achieve a similar effect, you can utilize a combination of background and padding styles:
li { background: url(images/bullet.gif) no-repeat left top; /* Adjust 'left' and 'top' for control */ padding: 3px 0px 3px 10px; /* Reset styles (optional): */ list-style: none; margin: 0; }
This method positions the bullet image using the background style and controls its spacing from the text using padding.
Considerations:
If you're aiming to style the parent list container (ul) to position your bulleted list items, refer to the A List Apart article mentioned in the provided answer for guidance.
The above is the detailed content of How Can I Position a List-Style-Image?. For more information, please follow other related articles on the PHP Chinese website!