Hello forum, I was looking at some css and i noticed on their stylesheet that they had some that were like "#footer" and some that were like ".footer". These are just examples but i am wondering what the difference is between the two. Help appreciated.
:D
k4m1k4z1:pinguin:
(#) and (.) classes
Started by k4m1k4z1, May 22 2010 06:31 PM
5 replies to this topic
#1
Posted 22 May 2010 - 06:31 PM
|
|
|
#2
Posted 23 May 2010 - 05:16 AM
There are two different ways to identify an HTML element: ID and Class. An HTML element can only have one ID, but multiple classes. Each ID should only be applied to one element, but a class can be applied to multiple elements. In CSS, # is used for an ID, . for a class.
#3
Posted 23 May 2010 - 12:41 PM
Thank you for your help, I was looking for an answer for quite some time now. I really appreciate your help.
#4
Posted 23 May 2010 - 01:44 PM
Glad I could help :)
#5
Posted 14 June 2010 - 10:04 PM
I have a similar question:
Why is it that in some instances styles applied to classes won't be applied but using ids: the style will apply?
I recently had a situation where classes wouldnt pass the styles to the multiple elements but once i used multiple ID's the style worked perfectly.
Why is it that in some instances styles applied to classes won't be applied but using ids: the style will apply?
I recently had a situation where classes wouldnt pass the styles to the multiple elements but once i used multiple ID's the style worked perfectly.
#6
Posted 21 June 2010 - 07:35 AM
Two examples:
<div id="something"></div>
CSS: #something {}
<div class="something"></div>
CSS: .something {}
<div id="something"></div>
CSS: #something {}
<div class="something"></div>
CSS: .something {}


Sign In
Create Account


Back to top









