CSS element Selector

Definition and usage

CSS element Selector used to select all elements with a specified element name.

Used in @namespace At this time, the selector can be namespace qualified.

  • ns|p - Select <p> elements within the namespace ns
  • *|p - Select all <p> elements
  • |p - Select all <p> elements that have not declared any namespace

Example

Select and set the styles for all <h1> elements, and select and set the styles for all <p> elements at the same time:

h1 {
  border: 2px solid green;
  background-color: beige;
}
p {
  background-color: yellow;
}

Try it yourself

CSS syntax

element {
  css declarations;
}

CSS syntax with namespace

namespace|element {
  css declarations;
}

Technical details

Version: CSS1

Browser support

Chrome Edge Firefox Safari Opera
Support Support Support Support Support