no not currently. Eventually you will be able to do it when CSS2 is supported in browsers with the following syntax :
class="classOne classTwo"
BTW a class name should always start with a letter. I imagine your class name 2 is just for example purpose but in case it wasn't I thought I would mention it. Gary
no that shouldn't work. that syntax is use when you want an elemental selector to have other features. however you could cheat the system using this example :
<html>
<head>
<title>check all</title>
<style>
a /* elemental selector */
{
color: red ;
}
a.two /* class selector on a element */
{
font-weight: bold ;
}
</style>
</head>
<body>
<a href="test.html">this is a test</a>
<a href="test.html">this is a test</a>
<a href="test.html">this is a test</a>
<a href="test.html" class=two>this is a test</a>
<a href="test.html">this is a test</a>
<a href="test.html">this is a test</a>
</body>
</html> Gary
Yuo can do what you want by combining CSS classes and IDs. Here's an example:
.class1 { font: 10pt arial,sans-serif; color: black }
#green1 { color: green }
#bold1 { font-weight: bold }
then in html body:
<p class=class1>this is black sans-serif text
<span id=green1>but this is green (color declaration in ID overrides the one from class)</span>.
</p>
<p class=class1 id=bold1>this is black and bold sans-serif text because it uses a combination of css class and id.
</p>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.