|
|
Subject:
css rule for causing an id to belong to a class
Category: Computers > Programming Asked by: alexis_gallagher-ga List Price: $10.00 |
Posted:
04 Nov 2004 06:31 PST
Expires: 04 Dec 2004 06:31 PST Question ID: 424321 |
I am trying to find out if there is a way to write a css rule that will cause a tag with a certain id attribute to automatically belong to a certain class and inherit all the properties already defined for that class. In other words, I would like to produce the effect of the following code #myid, .myclass { blah-blah-blah } but by writing something in the following form: .myclass { blah-blah-blah } #myid { what goes here? } FYI, I am doing this because the rule ".myclass { blah-blah-blah }" is defined in a stylesheet outside of my administrative control and defines rules that are complex and subject to change. Thus, it is not acceptable for me to have to modify, reproduce, or even view the content of "blah-blah-blah". A helpful answer will tell me the syntax I need, or else tell me why it is impossible in terms of css language definition. Alexis | |
| |
|
|
There is no answer at this time. |
|
Subject:
Re: css rule for causing an id to belong to a class
From: lombardp-ga on 08 Nov 2004 03:17 PST |
As you can read here: http://archivist.incutio.com/viewlist/css-discuss/2685 In CSS it is not possible to define one element in terms of another. However, if you can accept a JavaScript solution: it is possible to read the style of YOURCLASS and create a new style rule to be applied to YOURID. The result is exactly what you need... but achieved with JavaScript. |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
Search Google Answers for |
Google Home - Answers FAQ - Terms of Service - Privacy Policy |