subclassed css elements

D

dfloss

Is it possible to subclass a css element, then modify it?

For example, given this definition:

TABLE.bordered {border-left: 1px solid; border-top: 1px solid;
border-bottom: 1px solid; border-right: 1px solid; border-color: #000}

....can you create a style based on it using shorthand (which in this
case would have no top border)?

..bordered2.bordered {border-top: none}
 
D

danrumney

dfloss said:
Is it possible to subclass a css element, then modify it?

For example, given this definition:

TABLE.bordered {border-left: 1px solid; border-top: 1px solid;
border-bottom: 1px solid; border-right: 1px solid; border-color: #000}

...can you create a style based on it using shorthand (which in this
case would have no top border)?

.bordered2.bordered {border-top: none}

Yes

See:

http://www.w3.org/TR/CSS21/selector.html#class-html

Dan Rumney
 
D

dfloss

Is it possible to subclass a css element, then modify it?
For example, given this definition:

TABLE.bordered {border-left: 1px solid; border-top: 1px solid;
border-bottom: 1px solid; border-right: 1px solid; border-color: #000}

...can you create a style based on it using shorthand (which in this
case would have no top border)?

.bordered2.bordered {border-top: none}

Those are both useful links.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top