TIL: CSS list-style-position property

undefined or mostly null.
Search for a command to run...

undefined or mostly null.
I was experimenting with this yesterday and I used the ::marker pseudo class to change the size of the list marker independent of the font size of the list itself. Worked in Firefox but didn't in chrome.
Yes, it's not supported in Chrome. See here: https://caniuse.com/#search=%3A%3Amarker%20pseudo
In this series, I will share articles related to best practices for building and deploying applications on the web with the JavaScript and Python programming languages.
The web is now dominated with more visual content than ever hence the need to consider ways of delivering these images with the smallest possible file size while maintaining optimal visual quality. The less file size, the faster the browser can down...
I wrote this article in December 2023 for an interview screening task and thought to share it today while clearing my drafts for some new content prep, just in case it's still helpful to someone out t

Hey! I’m super excited to announce that I have joined the Secretariat Team at the Digital Public Goods Alliance. In this role, I leverage my passion for open source and technical background to assess DPG applications, provide technical support and ad...

Creative designs have become more important than ever in the software ecosystem today with many industries and end-consumers having several use cases that require them to offer design editing solutions to either designers or end-consumers. Every busi...

With the rise of artificial intelligence (AI) and large language models (LLMs), it has become easier to solve different human problems than ever before. Even consumers with little to no technical expertise can benefit from AI. Humans can now automate...

Some years ago, GitHub introduced the new Profile README feature that allowed GitHub users to pin a markdown file on their profile using a special repository named after their GitHub username. Since then, developers have used this file as a quick por...

The HTML list tag allows you to list ordered and unordered items. One major UI problem I had with list items is the position of the ::marker (bullet) pseudo-element in a list item.
The
::markerpseudo-element selects the marker box of a list item, which contains the list bullet or number to display the list item. This is used in tags like<li>and<summary>elements.
Sometimes, the list item's bullet has some left margin irregularities which make lists not so good looking with respect to the page's default spacing layout. I had to solve this by hacking the extra spacing and adding some left margin.

Today I learned about the CSS list-style-position property that sets the position of the ::marker relative to a list item and allows you to decide the position of the bullet.
list-style-position: insideHere, the ::marker is the first element among the list item's contents; hence the bullet will be inside the list item.
<ul>
<li>Apple</li>
<li>Orange</li>
<li>Banana</li>
<li>Mango</li>
<li>Grapes</li>
</ul>
ul {
list-style-position: inside;
}
list-style-position: outsideHere the ::marker is outside the element's box; hence the bullet will be outside the list item. This is the default position of a list item.
<ul>
<li>Apple</li>
<li>Orange</li>
<li>Banana</li>
<li>Mango</li>
<li>Grapes</li>
</ul>
ul{
list-style-position: outside;
}
You can use some global syntax values.
list-style-position: inherit;
list-style-position: initial;
list-style-position: unset;

src="https://caniuse.com/#search=list-style-position"