top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is an ID selector in CSS and how is it used?

0 votes
517 views
What is an ID selector in CSS and how is it used?
posted Jun 19, 2017 by Deepa

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

ID selectors are used to identify and apply styling to a single specific HTML element. ID selectors are defined within the HTML page by inserting an ID in the HTML element.
Example:

<h1 id="id-selector">Lorem Ipsum</h1>

ID selectors are defined within the CSS page by calling a ‘#’ followed by the name of the ID.
Example:

#id-selector {
font-family: Arial;
font-size: 20;
}

ID selectors are unique and can only be applied to a single element.

answer Jun 21, 2017 by Sanam
...