This is probably a n00bish question but what IS the difference? In a lot of tutorials classes are used for things like DIVs while id's are used for UL and LI etc but can someone explain why....thank you
EDIT: i've come across another problem - i've been trying to align text in a DIV box to the bottom right but it doesn't seem to work, I used the 'align' and 'valign' HTML properties but the text only aligns to the right not to the bottom, any ideas?
"class" and "id" - what's the difference
There was a discussion about Class vs ID only a couple of days ago:
http://www.csscreator.com/css-forum/ftopic6490.html
It's probably worth giving the forum search function a workout, most issues have been covered before.
"class" and "id" - what's the difference
In the css, replace valign (a html property) with vertical-align (a css property).
Keep in mind, vertical-align: center (or middle) won't work - do a search.
"class" and "id" - what's the difference
In the css, replace valign (a html property) with vertical-align (a css property).
Keep in mind, vertical-align: center (or middle) won't work - do a search.
The html attribute, valign, and the css property, vertical-align, are not equivalent.
The VALIGN attribute can be used to explicitly specify the vertical alignment of material within caption,col, colgroup, tbody, td, tfoot, th, thead, and tr. In other words, it belongs to the table elements.
The vertical-align property controls placement within the line-box according to the inline formatting model. It is more complex than I can explain.

This is probably a n00bish question but what IS the difference [between "id" and "class"]? In a lot of tutorials classes are used for things like DIVs while id's are used for UL and LI etc but can someone explain why....thank you
An id is simply a name that that identifies a single element, just as "John" refers to a particular individual. A class applies to (possibly) many individuals. For example, all individuals with red hair are in the class, "redhead". Each document may have only one "John" element, but may have any number of "redhead" elements.
Both are handy for their ability to categorize elements. For example, you might have a header across the top of your page. By giving it an id, say #banner, you can create a div of that name and set property values for all elements that descend from that div, and not affect those same elements that are not descendent from #banner. You can have only one #banner.
Class is more promiscuous. You may have any number. They are handy for causing the same values to be applied at different times. You may wish to have some text appear in red, have a line-over, an outset border, and x-large font size. You can make a class, "red" with those properties, and apply it as needed throughout the document.
cheers,
gary