CSS ID Selector

HTML Entities can be accessed using their ID attribute. So we can use ID as a selector for the HTML Entities, and we can create a set of styling rules for the HTML entity having the defined value for their ID attribute.

Syntax:

Example:

This CSS rule be applied to HTML Element having ID attribute value “nav”

We can define styling rules for a selected HTML Tag having specific value for their ID attribute

Means this CSS can be applied only on <p></p> tag having ID=”nav”