CSS #id Selector

Definition and Usage

CSS #id Selector is used to select elements with a specified id.

Example

Set the style of the element with id="firstname":

#firstname {
  background-color: yellow;
{}

Try It Yourself

CSS Syntax

#id {
  CSS Declarations;
{}

Technical Details

Version: CSS1

Browser Support

Chrome Edge Firefox Safari Opera
Support Support Support Support Support

Related Pages

CSS Tutorial:CSS id selector

CSS Tutorial:CSS id selector detailed explanation