Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. CSS
  3. Reference
  4. Selectors

CSS selectors

CSS selectors are patterns used inCSS rules to target and select specific elements for styling.

For example, to style paragraphs, you will use theptype selector to select all<p> elements and apply a style to them:

css
/* Set font size on all <p> elements */p {  font-size: 12px;  color: rebeccapurple;}

Syntax

css
/* Select elements and apply styles */selector {  property: value;}

Index of selectors

Specifications

Specification
Selectors Level 4

Check thepseudo-classes andpseudo-elements pages for their respective specification tables.

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp