FANDOM


This Forum has been archived

Visit the new Forums
Forums: Index Community Central Forum Adding a class using CSS?
FANDOM's forums are a place for the community to help other members.
To contact staff directly or to report bugs, please use Special:Contact.

50px-Replacement filing cabinet.svg

Note: This topic has been unedited for 3581 days. It is considered archived - the discussion is over. Do not add to unless it really needs a response.


Hi. Is it possible to assign classes using CSS, or at least inherit properties and values from a specified class using CSS? For example, I dunno...

.body { extraclass:(classname); }

Hope that makes sense. Thanks. THB Talk 01:26, November 30, 2010 (UTC)

No. But you can do it with Javascript, either in your MediaWiki:wikia.js , or from another MediaWiki .js page that is placed with <verbatim> tags where it is needed. See [1]. --◄mendel► 08:34, November 30, 2010 (UTC)
CSS does not allow inheriting another class in a selector-definition.
You can however "combine" classes by specifying multiple classes on the elements you use in your html.
Like fe.:<element class="class1 class2">something</element>
This will in effect enable you to have that element, and its decedents, inherit properties from all classes supplied.
See also: CSS Tutorial
⇐⇑©TriMoon™TalkHandyWikiLinks @ 06:12, December 3, 2010 (UTC)
Community content is available under CC-BY-SA unless otherwise noted.