Krewe Posted August 14, 2011 Share Posted August 14, 2011 Kind of a lame question but I figure I need clarification.What is the difference between using a class identifier or ID?I have been using ID for all my Divs. Is that wrong?Thanks guys ~Krewe Link to comment Share on other sites More sharing options...
Drycodez Posted August 14, 2011 Share Posted August 14, 2011 Yap, it is wrong to use a particular #id for more than one element. Id is suppose to be unique! u can assign more than one element to a class because a class is like a group. Wen you assign 5 elements to a group, the 5 element will belong to that group, but id is just an idententity to one particular element. Let me use you for example. You can belong to a group, which is called MALE and other guys can also belong to the same group becouse you are not the only male around, but your identity (e.g the way u talk, your colour, your eye color, the way you talk, walk, etc), only belongs to you and somebody else cannot have everything you have, there must be a little diffrence. Link to comment Share on other sites More sharing options...
Drycodez Posted August 14, 2011 Share Posted August 14, 2011 The reason you are unique, its because you have your own identity(id), but you belong to a class (humans) and you can also belong to another class (those who play football) if you wish. You can give more than one element a particular id, it will WORK, but its wrong, because its not supposed to be so. I can't have your identity, but if i wish to have it, i can do a Surgery, and i ll have it, but its wrong and its not supposed to be so. Hope this helped in a little way? Link to comment Share on other sites More sharing options...
thescientist Posted August 14, 2011 Share Posted August 14, 2011 :)um, I'll just let the tutorials do the explanation. http://www.w3schools.com/css/css_id_class.aspPretty simple though. Use and ID once on a page to uniquely target an element. To target multiple elements, use a class. Link to comment Share on other sites More sharing options...
Drycodez Posted August 14, 2011 Share Posted August 14, 2011 :)um, I'll just let the tutorials do the explanation. http://www.w3schools.com/css/css_id_class.aspPretty simple though. Use and ID once on a page to uniquely target an element. To target multiple elements, use a class.just wanted to make sure CREWE gets it! Link to comment Share on other sites More sharing options...
Krewe Posted August 14, 2011 Author Share Posted August 14, 2011 I like Samuel's explanation better!Thanks you two, I was reading some threads and this came up and I thought **** .Might be why I had some issues.~Krewe Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.