Go Back   Site Owners Forums - Webmaster Forums > Web Design > Graphic Design

Notices


Reply
 
Thread Tools Rate Thread Display Modes
Old 08-25-2014, 10:33 PM   #1
doccs us
Registered User
 
Join Date: Aug 2014
Posts: 77
The Difference Between ID and Class

The Difference Between ID and Class
doccs us is offline   Reply With Quote

Old 08-25-2014, 11:40 PM   #2
ledtubelight
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.
ledtubelight is offline   Reply With Quote
Old 08-26-2014, 01:37 AM   #3
freelancer
Registered User
 
Join Date: Apr 2014
Location: Freelancer
Posts: 14
Quote:
Originally Posted by ledtubelight View Post
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.
Good description. Thanks for the information.
__________________
Adeel Ather

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
freelancer is offline   Reply With Quote
Old 08-26-2014, 09:06 PM   #4
johnstyle
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.
johnstyle is offline   Reply With Quote
Old 08-10-2016, 10:57 PM   #5
pxljobs
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.
pxljobs is offline   Reply With Quote
Old 08-11-2016, 02:45 AM   #6
nomi147
Registered User
 
Join Date: Jul 2016
Posts: 142
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.
nomi147 is offline   Reply With Quote
Old 08-12-2016, 12:21 AM   #7
Claire_Anderson
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.
Claire_Anderson is offline   Reply With Quote
Old 08-19-2016, 01:55 AM   #8
hemaweb
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.
hemaweb is offline   Reply With Quote
Old 08-20-2016, 01:40 AM   #9
daniewalker
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.
daniewalker is offline   Reply With Quote
Old 08-29-2016, 11:01 PM   #10
adlersmith
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.
adlersmith is offline   Reply With Quote
Old 09-06-2016, 01:56 AM   #11
SaraSanjay
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.
__________________
SaraSanjay is offline   Reply With Quote
Old 03-27-2017, 02:11 AM   #12
avemlfy
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.
avemlfy is offline   Reply With Quote
Old 03-28-2017, 07:14 AM   #13
hongta
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.
hongta is offline   Reply With Quote
Old 03-28-2017, 07:59 AM   #14
tourism123
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.
tourism123 is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
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


All times are GMT -7. The time now is 07:48 AM.


Powered by vBulletin Copyright © 2020 vBulletin Solutions, Inc.