CSS Type Selector
Description
The Type selector targets all elements of a specific HTML tag name and applies styles to every matching element in the document. It is one of the most fundamental selectors in CSS and forms the foundation of how styles cascade across a page. By using a type selector, you can apply consistent styling to all instances of an element - such as paragraphs, headings, or lists - without needing classes or IDs. This makes it especially useful for setting global typography, spacing, or layout rules early in your stylesheet.
Because the Type selector works directly with HTML elements, it is closely tied to semantic markup. For example, styling the <p> element affects every paragraph, while styling <h1> applies to all top-level headings. This makes it ideal for defining a visual baseline for commonly repeated structures. You’ll often see it used alongside layout-related properties such as margin, font-size, or line-height to improve readability and consistency across a page.
The Type selector also participates fully in CSS specificity and inheritance rules. It has lower specificity than a class selector or an ID selector, meaning its styles can be easily overridden when more targeted rules are applied. This makes it well suited for defining defaults rather than exceptions. It also works well in combination with the descendant selector, allowing you to scope element styles within a particular section of the document.
Here is a simple example showing how a type selector works:
p {
font-size: 1rem;
line-height: 1.6;
margin-bottom: 1em;
}
<p>This paragraph will receive the defined styles.</p>
<p>So will this one.</p>
In this example, every <p> element on the page will inherit the same spacing and text sizing. The selector does not require any additional attributes or classes - its power comes from targeting the element type itself.
The Type selector is especially effective when used thoughtfully with semantic HTML elements such as article, section, and header. This approach keeps your CSS clean, predictable, and easier to maintain, while reinforcing the meaning and structure of your markup.
Syntax
element { css declarations; }
Example
Browser Support
The following information will show you the current browser support for the CSS Type selector. Hover over a browser icon to see the version that first introduced support for this selector.
This CSS type selector is supported by all modern browsers.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 2nd January 2026
