THE WORLD'S LARGEST WEB DEVELOPER SITE

CSS element,element Selector


Example

Select and style all <h1> elements AND all <p> elements:

h1, p {
    background-color: yellow;
}

Try it yourself »

Definition and Usage

To style several elements with the same style, separate each element name with a comma.

Version: CSS1

Browser Support

Selector
element,element Yes Yes Yes Yes Yes

CSS Syntax

element, element {
    css declarations;
} Demo



COLOR PICKER

colorpicker

SHARE THIS PAGE






Search w3schools.com:

Translate w3schools.com: