Answer:
The ID selector uses the “ID” attribute of the target HTML element to select it. The constraint to work is that the ID should be unique within a page so that the selector can point it out correctly.
To build an ID selector expression, start with a hash (#) character, followed by the id of the element.
Here is an example which selects a paragraph element using its ID.
#sample {padding: 10px;}
<p id="selector">...</p>
To build an ID selector expression, start with a hash (#) character, followed by the id of the element.
Here is an example which selects a paragraph element using its ID.
#sample {padding: 10px;}
<p id="selector">...</p>
Previous Question | Next Question |
Tell us how can you refer to CSS file in the web page? | Tell me what Are Pseudo-Classes In CSS? |