Is there a way to increase the space between the number and the text of each <li>?
Answer
Yes there is a way to do this! We can use CSS to target the <li> elements and then apply some left padding to them. This will nudge the text to the right, away from the numbers. To learn more about how to change the look of our pages, check out our Learn CSS course.
Conversely, is there a way to decrease the space between the number (or marker) and the text of each <li>?
Negative values given to padding and border attributes don’t seem to work, while negative values for margin and position-related (e.g. left)* attributes shift the list item together with the number/marker.
*changed the spelling from “(i.e. left)” to “(e.g. left)”
That is right. My question was whether there is a way where we can reduce the space between the marker of a list item (li) element and the text (or the content) of the li element. As giving negative values to the left attribute, for example, shifts both the text/content of the li element and also shifts the marker of the li element, so then is there a way to move only the text/content of the li element, but not move the marker?
From inspecting the page code, I see that the browser inserts a ::marker element nested inside the li element and right after the opening <li> tag, but it seems that its margin (and/or position) can’t be changed.
This is the result (it shifts both the (item1 and item2) texts of the liand the disc maker to the left, but I want only the texts to move and the disc marker to remain in the same place as it was before):
Can there be something done so that the marker moves to the right (or the text moves to the left without the marker also moving to the left)? If so, what?
Hi I’m new here. I’ve gone through list and paragraph, but there is one problem I want to know. Is there a way to add indent for the paragraph to display in browser.
For example, like magazine there or book, there are always indent at the beginning.