I’m just start learing html and css, and I just wonder if there a way to change the font size of the unorder list tag alone? –>
For example,
only this part not the whole text –>(.) list 1
Thank you so much for the answer.
really appriciate it.!!
I’m just start learing html and css, and I just wonder if there a way to change the font size of the unorder list tag alone? –>
For example,
only this part not the whole text –>(.) list 1
Thank you so much for the answer.
really appriciate it.!!
2
Answers
In order to customize the
.
of the list you need to style the::marker
Pseudo Element.Learn more about
::marker
Yes, you can change the font size of the text in an unordered list (
) without affecting the rest of the page text by using CSS. Here’s an example:
HTML:
In this example, the third list item has a class of “small”, which we will use to target it with CSS.
CSS:
In this CSS example, we set the font size for the entire unordered list to 16 pixels using the ul selector. Then, we use the ul li.small selector to target only the list items with the "small" class, and set their font size to 12 pixels.
This way, only the text in the third list item (with the "small" class) will have a smaller font size, while the rest of the list and the page text will remain unaffected.