![]() |
#1 |
Registered User
Join Date: Aug 2014
Posts: 77
|
The Difference Between ID and Class
The Difference Between ID and Class
|
![]() |
![]() |
![]() |
#2 |
Registered User
Join Date: Aug 2014
Location: Surat
Posts: 847
|
ID's
ID, short for fragment identifier, is a beautiful attribute, but it's very easy to use them improperly. You can only use an ID name once in any XHTML or HTML document. Classes Classes, like ID's, can also be used to in JavaScript scripts, but unlike ID's, they can be used multiple times in the same HTML document.
__________________
I am SEO expert and handling SEO for following words To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. , To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. , To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. , To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. |
![]() |
![]() |
![]() |
#3 | |
Registered User
Join Date: Apr 2014
Location: Freelancer
Posts: 14
|
Quote:
__________________
Adeel Ather To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. |
|
![]() |
![]() |
![]() |
#4 |
Registered User
Join Date: Dec 2013
Posts: 327
|
ID's are unique
Each element can have only one ID Each page can have only one element with that ID Classes are not unique We can use the same class on multiple elements. We can use multiple classes on the same element. |
![]() |
![]() |
![]() |
#5 |
Registered User
Join Date: Jul 2016
Location: Bangalore
Posts: 370
|
ID:
Element can only one id,each page have only one element with id it is unique one. Class: It will be used for java script it will used multiple times in same html document.
__________________
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. |
![]() |
![]() |
![]() |
#6 |
Registered User
Join Date: Jul 2016
Posts: 141
|
A lot of web designers new to the field aren't aware of the differences between ID's and classes. So here's a fairly brief article outlining proper and improper uses of the two.
__________________
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. |
![]() |
![]() |
![]() |
#7 |
Registered User
Join Date: Aug 2016
Posts: 40
|
In general, you can can create a class in a style sheet and add some styling code in it and you can use that class name to apply same type of styles to other objects in the UI like text or headings or paragraph without copying the code in the style sheet again.
|
![]() |
![]() |
![]() |
#8 |
Registered User
Join Date: Jul 2016
Posts: 103
|
ID:
id short for fragment identifier, is a beautiful attribute, but it's very easy to use them improperly. You can only use an ID name once in any XHTML or HTML document. Duplicate ID tags will cause your page to fail validation, and can have negative effects when using JavaScript with them. Classes: classes like ID's, can also be used to in JavaScript scripts, but unlike ID's, they can be used multiple times in the same HTML document.
__________________
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. |
![]() |
![]() |
![]() |
#9 |
Registered User
Join Date: Aug 2016
Posts: 56
|
ID are Unique
Each element can have only one ID Each page can have only one element with that ID Class are Not Unique You can use the same class on multiple elements. You can use multiple classes on the same element.
__________________
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. |
![]() |
![]() |
![]() |
#10 |
Registered User
Join Date: Dec 2015
Posts: 277
|
The ID selector is further specific than class, and the natural stream has been overridden. Class allocates you to prevent duplicating styles unnecessarily. You can also consist of several classes using only one attribute.
__________________
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. |
![]() |
![]() |
![]() |
#11 |
Registered User
Join Date: May 2016
Posts: 551
|
ID's
ID, short for fragment identifier, is a beautiful attribute, but it's very easy to use them improperly. You can only use an ID name once in any XHTML or HTML document. Classes Classes, like ID's, can also be used to in JavaScript scripts, but unlike ID's, they can be used multiple times in the same HTML document. __________________ |
![]() |
![]() |
![]() |
#12 |
Registered User
Join Date: Jan 2017
Posts: 261
|
id is use with # and class use with '.' .
__________________
We are one of the leading To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. and best To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. . We are the professional To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. & ensure customer satisfaction. |
![]() |
![]() |
![]() |
#13 |
Registered User
Join Date: Mar 2017
Posts: 81
|
ID's are unique
Each element can have only one ID Each page can have only one element with that ID Classes are NOT unique You can use the same class on multiple elements. You can use multiple classes on the same element.
__________________
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. |
![]() |
![]() |
![]() |
#14 |
Registered User
Join Date: Mar 2017
Posts: 264
|
ID's are unique.Classes are not unique
__________________
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. |
![]() |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Have you ever wondered what is inside a java class file? | cianfie | Java | 6 | 01-28-2015 11:09 PM |