Styling List li Elements To Square, Circle and Image

Styling List li Elements To Square, Circle and Image

List elements <li> are used to make a list with points with in a html document and these points can be circle , square or disc. By default the list <li> points are represented with a disc but you can style them further with use of custom CSS. Below is the CSS for each type of list points which can be used in html also in the end of article there is CSS which can be used if you want to use any custom image in place of these points.



Table of contents 

CSS for square list type

ul li {
list-style-type:square;
}
ul li a:hover {
text-decoration:none;
}

CSS for circle list type

ul li {
list-style-type:circle;
}
ul li a:hover {
text-decoration:none;
}

CSS for disc list type

ul li {
list-style-type:disc;
}
ul li a:hover {
text-decoration:none;
}

CSS for image list type

ul li {
list-style-image: url('https://3.bp.blogspot.com/-dog9DlW1G9U/WTzmUYP_OfI/AAAAAAAAB3A/zz5qHPT_FdQd8H0HqyVu0QMxhR0Bg0c8wCLcB/s1600/big-square.gif');
}
ul li a:hover {
text-decoration:none;
}


Where to add CSS ?

To add CSS in blogger go to Blogger > Theme > Customize > Advanced > Add CSS enter CSS , press enter once and Apply to blog.
For wordpress launch your site customizer then click on the CSS tab to access the CSS editor.

No comments:

Post a Comment