Adding CSS to HTML Lists

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 HT…


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

  1. Rascal Flatts
  2. Little Big Town
  3. Restless Heart
  4. Little Feat
  5. The Beatles
  6. 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


Print Share Comment Cite Upload Translate Updates
APA

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/

MLA
" » Adding CSS to HTML Lists." Charity Parks | Sciencx - Sunday October 17, 2021, https://www.scien.cx/2021/10/17/adding-css-to-html-lists/
HARVARD
Charity Parks | Sciencx Sunday October 17, 2021 » Adding CSS to HTML Lists., viewed ,<https://www.scien.cx/2021/10/17/adding-css-to-html-lists/>
VANCOUVER
Charity Parks | Sciencx - » Adding CSS to HTML Lists. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/10/17/adding-css-to-html-lists/
CHICAGO
" » Adding CSS to HTML Lists." Charity Parks | Sciencx - Accessed . https://www.scien.cx/2021/10/17/adding-css-to-html-lists/
IEEE
" » Adding CSS to HTML Lists." Charity Parks | Sciencx [Online]. Available: https://www.scien.cx/2021/10/17/adding-css-to-html-lists/. [Accessed: ]
rf:citation
» Adding CSS to HTML Lists | Charity Parks | Sciencx | 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.

You must be logged in to translate posts. Please log in or register.