Приглашаем посетить
Чернышевский (chernyshevskiy.lit-info.ru)

Universal Selectors

Previous Page
Table of Contents
Next Page

Universal Selectors

Universal selectors are used to select any element. For example, to set the margins and padding on every element to 0, * can be used as shown in Listing 3.9.

Listing 3.9. CSS Code Containing the Universal Selector
*
{
     margin: 0;
     padding: 0;
}

Universal selectors also can be used to select all elements within another element as shown in Listing 3.10. This will select any element inside the <p> element.

Listing 3.10. CSS Code Containing the Universal Selector Within the <p> Element
p *
{
     color: red;
}


Previous Page
Table of Contents
Next Page