CSS Lists and Text Decoration
Hello friends 👋 welcome back. In the last tutorial, we explored CSS backgrounds and learned how to use colors, images, and gradients to make our pages stand out. Today, we are going to style something we often use in web design, lists and text decoration.
Styling Lists in CSS
HTML gives us two main types of lists, unordered lists <ul> and ordered lists <ol>. By default, unordered lists show bullets, and ordered lists show numbers. With CSS, you can customize these lists to look more attractive.
Example:
In this example, the unordered list uses square bullets, and the ordered list uses Roman numerals.
Other values for list-style-type include, disc, circle, decimal, lower-alpha, upper-alpha, lower-roman, and none (to remove bullets or numbers).
You can also use images as list markers with list-style-image:
This will replace the bullets with your own image.
Text Decoration
Text decoration controls extra styling for text, such as underlines, lines through text, and overlines.
Example:
Common values for text-decoration are underline, overline, line-through, and none.
Try It Yourself
Create a file called lists.html. Inside it, write one unordered list and one ordered list. Use CSS to change the bullet styles and number styles. Then add some paragraphs and try different text decorations. Experiment with combining colors, fonts, and text-decoration to see how creative you can get.
Awesome work 🎉 You just learned how to style lists and decorate text with CSS. In the next tutorial, we will move on to CSS Fonts and Google Fonts, where we will explore how to use custom fonts to make your website look modern and unique. 🚀
0 Comments