Web Hosting Talk







View Full Version : Quick class question


Oakii
03-15-2005, 10:33 PM
Am I allowed to have multiple classes?

example:

style.css

.first{
width:200px;
}
.second{
height:100px;
}


file.html

.....
<table cellpadding="0" cellspacing="0" class="first, second">
blah blah
</table>


Also, how do I put cellpadding into the css file?

portalplanet
03-15-2005, 10:45 PM
Padding: http://www.htmlhelp.com/reference/css/box/padding.html .

Why would you want to have 2 classes? I guess to test it use file.html and then take out the first in styles.css and see if the table goes to the second style.

Justin

Oakii
03-15-2005, 11:47 PM
I wanted multiple classes so that:

I can have a set of different fonts/color/size

Other sets of specific size
and so on

That way, i can combine them and cut the css file size (even though it's negligible on todays connection.

ub3r
03-16-2005, 01:49 AM
read this: http://www.quirksmode.org/css/multipleclasses.html

Oakii
03-17-2005, 02:25 AM
Just what I needed, thanks much

andbin
03-18-2005, 04:46 AM
Originally posted by Diaga
<table cellpadding="0" cellspacing="0" class="first, second">


Class names in the class attribute must be separated only by spaces.

Normally there is no need to have more classes for a tag, but sometimes could be useful to have separated classes (each one for a specific use) combined together.