SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
-
Apr 24, 2005, 22:02 #1
- Join Date
- Feb 2004
- Location
- Kentucky, USA
- Posts
- 108
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Shaving off those last few KB's...
Is it possible to define multiple background's for a class/id without redefining all of the other attributes?
To clarify, I have a DIV spanning across the top of my page, with my logo set as the background. I want to be able to change this logo by simply defining a different class or a unique ID - without having to define the height, width, and background color each time in the style sheet. Is this possible?
-
Apr 24, 2005, 22:21 #2
- Join Date
- Feb 2005
- Posts
- 581
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Perhaps you can use multiple class assignment to accomplish this. In one class you define the width, height, etc. and in the other whatever else you want.
HTML Code:<style type="text/css"> .classOne { height: 10%; width: 100%; /* other properties */ } .classTwo { /* some more properties */ } </style> <div class="classOne classTwo">...</div>
P.S. Now that I've though about it I'm not sure what you intend to do. Perhaps this may not be it but maybe it'll help.
-
Apr 24, 2005, 22:22 #3
- Join Date
- Mar 2005
- Location
- USA
- Posts
- 5,482
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Yes.
Most elements can have an ID and belong to multiple classes.We miss you, Dan Schulz.
Learn CSS. | X/HTML Validator | CSS validator
Dynamic Site Solutions
Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.
-
Apr 26, 2005, 10:34 #4
- Join Date
- Feb 2004
- Location
- Kentucky, USA
- Posts
- 108
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Yep, this is perfect! Thanks so much for your help, guys!
Bookmarks