This content originally appeared on DEV Community and was authored by Charity Parks
CSS properties can control the appearance of HTML elements. Such properties can add backgrounds to parts or to all of your webpage. The CSS properties can put borders around some of your content, or change the style of bullet points.
If you have a HTML list you want to style with CSS, you can do something like the following:
(HTML code)
<h1>
Favorite Music Groups</h1>
<ol>
<li>
Rascal Flatts</li>
<li>
Little Big Town</li>
li>
Restless Heart</li>
<li>
Little Feat</li>
<li>
The Beatles</li>
<li>
Lady A</li>
</ol>
It would look like this:
Favorite Music Groups
- Rascal Flatts
- Little Big Town
- Restless Heart
- Little Feat
- The Beatles
- Lady A
Now add CSS.
ol {
list-style-type: lower-roman;}
It would look like this:
Favorite Music Groups
i. Rascal Flatts
ii. Little Big Town
iii. Restless Heart
iv. Little Feat
v. The Beatles
vi. Lady A
There are a lot of CSS properties to choose from to change the style of your HTML elements!
Happy Coding!
This content originally appeared on DEV Community and was authored by Charity Parks
Charity Parks | Sciencx (2021-10-17T20:37:52+00:00) Adding CSS to HTML Lists. Retrieved from https://www.scien.cx/2021/10/17/adding-css-to-html-lists/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.