CSS List

CSS used three types of list styling:

  • Unordered lists — A list of items, where every list items are marked with bullets.

  • Ordered lists — A list of items, where each list items are marked with numbers.

  • Definition list — A list of items, with a description of each item.

 

  

Ex.

       ul {

          list-style-type: square;

        }

      ol {

          list-style-type: upper-roman;

       }

Used inside another list:

Ex.

       ul.in li {

          list-style-position: inside;

       }

      ul.out li {

        list-style-position: outside;

      }

                                      

Using the image as a marker:

Ex.

      <style type="text/css">

       ul li {

            list-style-image: url("/examples/images/arrow.png");

        }

       </style>

 

 

Selector of CSS

Two types of selector used in CSS:

Id selector:

Used (#) sign to select id

   #h1{

         color: red;

      }

Class selector:

Use period sign (.) to select class:

   .h1 {

        color: blue;

       }

Other many selectors are used which is given below:

  • Adjacent Sibling Selectors

  • Child Selectors

  • General Sibling Selectors

  • Grouping Selectors

  • Universal selectors

Powered  by Codersarts