You are here: Re: set a class to another class in a CSS stylesheet « HTML « IT news, forums, messages
Re: set a class to another class in a CSS stylesheet

Posted by Jukka K. Korpela on 03/05/07 13:29

Scripsit Ciaran:

> Hi is it possible to set a class to another class in a stylesheet
> file?

No. Classes don't exist in CSS at all. They exist in markup; CSS just refers
to them.

> As circumstance would have it I need to do something like this:
>
> .class1{ color:#ccc;}
>
> .class2{ class:class1; width:200px;}

No, you don't need to do such things. You should not set color without
setting background, and you should not set widths in pixels excep in special
occasions.

You might find use for things like

..class1, .class2 { color: #ccc; background: white; }

..class2 { width: 15em; }

(with more sensible class names of course).

> It kind of goes agains the whole "cascading" idea

This has absolutely nothing to do with the cascade, which is the most
misunderstood concept in the Whole Wide Web.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация