Open In App

CSS element Selector

Last Updated : 29 Aug, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

The element selector in CSS is used to select HTML elements that are required to be styled. In a selector declaration, there is the name of the HTML element and the CSS properties which are to be applied to that element is written inside the brackets {}. 

Syntax:

element {
\\ CSS property
}

Example 1: This example shows the element selector in CSS.

Output:

  

Example 2: This example shows the element selector in CSS.

Output:

  

Supported Browsers: The browser supported by element selectors are listed below:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Safari
  • Opera

Similar Reads