If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

CSS: The id selector

The id selector is a way to select only the element with the specified id, and apply styles to that element. The selector must start with a pound sign (#) and then the value of the id attribute. The browser will then look for a tag in the page that has an id attribute equal to that id.
The spelling and the casing must be exactly the same - "#sun-descrip" is different from "#Sun-Descrip". The page should not have multiple tags with the same id- every id should be unique.

Want to join the conversation?

No posts yet.