Skip to content

CSS Selectors

ID

About

The #id selector matches the element with the given id.

Element by id

The selector #one matches the element with the id one.

Duplicate id

The id of an element should be unique on the page. If, for some reason, you have multiple elements with the same id, all of them will be matched. This is just to demonstrate the behavior, you should never have duplicate IDs.