Webmaster Forums - Website and SEO Help

Web Development and Design => Website Design and HTML => Topic started by: 12Three on March 18, 2019, 12:00:23 AM

Title: What is the difference between ID and Class selector?
Post by: 12Three on March 18, 2019, 12:00:23 AM
What is the difference between ID and Class selector?
Title: Re: What is the difference between ID and Class selector?
Post by: sinelogixtech on June 06, 2019, 12:54:43 AM
In the CSS, a class selector is a name preceded by a full stop (".") and an ID selector is a name preceded by a hash character ("#"). The difference between an ID and a class is that an ID can be used to identify one element, whereas a class can be used to identify more than one.
Title: Re: What is the difference between ID and Class selector?
Post by: hannahmaxtra on September 03, 2019, 05:19:49 AM
For setting styles of different elements you use CSS styles.Before you can apply styles to any HTML element you need to select the elements using the CSS selectors.

The two useful types of selectors are:

id selector the elements with the specified id.
A class selector selects the elements which have a specific class.
For example, if you want to apply styles to elements which have class attribute as class1 then you can use the following definition:

.class1{

//style defintions

}

and if you want apply styles to element which has id of id1 then you can use the following definition:

#id1{

//style defintions

}
Title: Re: What is the difference between ID and Class selector?
Post by: cityweb on February 27, 2020, 05:33:58 AM
With ID selector we can select an element by pointing out the unique ID name set with the id attribute and when we want to style more than one object on a web page, we should be using a class selector.
Title: Re: What is the difference between ID and Class selector?
Post by: RH-Calvin on March 23, 2020, 08:47:29 AM
In the CSS, a class selector is a name preceded by a full stop (".") and an ID selector is a name preceded by a hash character ("#"). The difference between an ID and a class is that an ID can be used to identify one element, whereas a class can be used to identify more than one.
Title: Re: What is the difference between ID and Class selector?
Post by: Citywebpuneind on November 08, 2021, 08:08:27 AM
With identity selector we can pick an element through mentioning the particular id name set with the identity characteristic and when we want to style more than one object on an internet page, we need to be the use of a class selector