• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Type Selectors

Type selectors will select any HTML element on a page that matches the selector.

In the HTML sample shown in Listing 3.1, there are seven HTML elements that could be used as type selectors, including <body>, <div>, <h1>, <p>, <ul>, <li>, and <a>.

For example, to select all <li> elements on the page, the <li> selector is used as shown in Listing 3.2.

Listing 3.2. CSS Code Containing Styling for the <li> Element

li
{
    color: blue;
}

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint