Go Back   Site Owners Forums - Webmaster Forums > Web Programming > Programming General

Notices


Reply
 
Thread Tools Rate Thread Display Modes
Old 08-25-2014, 10:37 PM   #1
JohnKumar
Registered User
 
Join Date: Aug 2014
Location: India
Posts: 147
The Difference Between ID and Class

The Difference Between ID and Class
__________________

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.
JohnKumar is offline   Reply With Quote

Old 08-25-2014, 11:15 PM   #2
ledtubelight
Registered User
 
Join Date: Aug 2014
Location: Surat
Posts: 847
ID, short for fragment identifier, is a beautiful attribute, but it's very easy to use them improperly.

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. This separation of content from presentation is what makes sites powered by CSS more robust, but some don't know the full extent to which they can use classes. Classes can not only be used more than once, but more than one can be used on an element:
__________________
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, 09:11 PM   #3
johnstyle
Registered User
 
Join Date: Dec 2013
Posts: 327
ID's are unique, Classes are NOT unique
Each element can have only one ID, the same class on multiple elements.
Each page can have only one element with that ID, multiple classes can be used on the same element.
johnstyle is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
The Difference Between ID and Class doccs us Graphic Design 13 03-28-2017 07:59 AM
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 04:33 PM.


Powered by vBulletin Copyright © 2020 vBulletin Solutions, Inc.