Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Inherintances

Reply
Thread Tools

Inherintances

 
 
freesoft_2000
Guest
Posts: n/a
 
      09-25-2006
Say I have a css class like:

.foo {
background-color: blue;
width: 500px;
}

and I have another class:

.central {
margin-left: auto;
margin-right: auto;
}

I want 'foo' to inherit the properties of 'central'.

Is this possible to be done?

Any help is greatly appreciated

Thank You

Yours Sincerely

Richard West

 
Reply With Quote
 
 
 
 
David Dorward
Guest
Posts: n/a
 
      09-25-2006
freesoft_2000 wrote:
> Say I have a css class


There is no such thing. HTML has classes, CSS doesn't.

> .foo {
> background-color: blue;
> width: 500px;
> }


That is a ruleset with a class selector, not a class.

> and I have another class:


Ditto

> I want 'foo' to inherit the properties of 'central'.


You can't, but see http://dorward.me.uk/www/css/inheritance/

 
Reply With Quote
 
 
 
 
Jonathan N. Little
Guest
Posts: n/a
 
      09-25-2006
freesoft_2000 wrote:
> Say I have a css class like:
>
> .foo {
> background-color: blue;
> width: 500px;
> }
>
> and I have another class:
>
> .central {
> margin-left: auto;
> margin-right: auto;
> }
>
> I want 'foo' to inherit the properties of 'central'.
>
> Is this possible to be done?



No inheritance in CSS but your can to this:

<ELEMENT class="foo central">...</ELEMENT>

then ELEMENT with have styling rules of 'foo' & 'central'


--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments