SitePoint Sponsor |
|
User Tag List
Results 1 to 5 of 5
-
Dec 22, 2003, 06:40 #1
- Join Date
- Dec 2002
- Posts
- 106
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Assigning properties between CSS elements
Hi,
Is it possible in css to assign properties of one element to other?
for example:
.element_1{
width:100%;
color:#FF0000;
}
.element_2{
font-family: Verdana;
}
Is it possible to assign element_1 to element_2 so that element_1 will be a reference?
Thanks
-
Dec 22, 2003, 06:54 #2
- Join Date
- Jan 2003
- Location
- Hampshire UK
- Posts
- 40,556
- Mentioned
- 183 Post(s)
- Tagged
- 6 Thread(s)
Hi,
If you mean can you do something like this:
.element_2{
width:element1.width;
}
Then no its not possible. You may be able to do something similar using ie expressions but it will only work for ie.
http://msdn.microsoft.com/library/de...dude061198.asp
Paul
-
Dec 22, 2003, 12:33 #3
Do you want the element_1 properties assigned to element_2? As well as the font-family property? If so you can just do:
Code:.element_1, .element_2 { width:100%; color:#FF0000; } .element_2 { font-family: Verdana; }
Code:.element_1 { width:100%; color:#FF0000; } .element_2 { width:100%; color:#FF0000; font-family: Verdana; }
-
Dec 23, 2003, 01:02 #4
- Join Date
- Dec 2002
- Posts
- 106
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thanks Paul O'B & Gamblingharry
Gamblingharry that is exactly what I looking for
Thanks
-
Dec 23, 2003, 04:17 #5
- Join Date
- Jan 2003
- Location
- Hampshire UK
- Posts
- 40,556
- Mentioned
- 183 Post(s)
- Tagged
- 6 Thread(s)
Do you want the element_1 properties assigned to element_2? As well as the font-family property? If so you can just do:
Bookmarks