Search within TutorialsPark

CSS Id Selector

Selects elements of the specified value for the id attribute.

Definition and Notes.

1. Similar to class, an Id Selector applies the styles to the elements with same Id attribute.

2. The id attribute is used to assign a unique identifier.It can be used only once per page to identify a single element.

3. To create the Selector you must prefix the ID name with a pound or hash(" # "), Eg: #Caution.


CSS Id selector. internetexplorer safari firefox opera chrome

View in Splitscreen»


Note: A given element can have both class and id attribute, but must try not to have the same name for them.

Related Examples.