You want this.
li {
list-style-position: inside;
}
ul { display: inline-block; } li { list-style-position: inside; background: orange; }
<ul> <li>Item1</li> <li>Item2</li> <li>Item3</li> <li>Item4</li> <li>Item5</li> </ul>
Your question is not easy to understand. Could you post an example of your code for us to help you better please?
From what I can make out, you have a li
that you want to add a background colour to, but you don't want it to start after the dot ( •
), but include the dot as well?
The property you are after is: list-style-position: inside;
li { background-color:red; list-style-position: inside; }
<ul> <li>asdf</li> <li>qwer</li> <li>zxcv</li> </ul>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.