I don't quite understand how the CSS namespace works, nor how things are inherited. Here's my situation:
In the top right corner of this intranet page there will be, say, three icons that link to commonly used pages in the site, but will be customized (on the server side via ASP) for each user. In effect there are 3 "slots" where icons (with links) can appear, and any icon can appear in any slot.
I define the slots like this:
That kind of thing. Then I have these mouseover (hover) icons that change shape when the user moves over them, icons that fit in the "slots," like this:
Each one individually works, but I want to combine them into the same space.
Because I don't understand how to have both things be true (due, I think, to a lack of understanding of the namespace and inheritance), I currently am forced to have a TON of styles, one for every icon in each possible slot, like this:
And then there's "iconphone2" and "iconphone3," and of course "iconcalendar1" and "iconcalendar2," etc., ad naseum.
I assume there's some kind of thing I can do if my stylesheets are designed correctly where I can reference something like "icon1.phone" or "icon2.phone" or "icon1.calendar," etc., but I'm not sure how to do it.
I apologize in advance if this is a really dumb question, as I'm only just learning CSS and know I've got a lot to learn.
In the top right corner of this intranet page there will be, say, three icons that link to commonly used pages in the site, but will be customized (on the server side via ASP) for each user. In effect there are 3 "slots" where icons (with links) can appear, and any icon can appear in any slot.
I define the slots like this:
Code:
#icon1 {
position: absolute;
right:130px;
top:10px;
width:60px;
height:50px;
}
#icon2 {
position: absolute;
right:70px;
top:10px;
width:60px;
height:50px;
}
Code:
#phone a {
display: block;
padding-top: 50px; height: 0px !important;
height /**/: 50px; overflow: hidden;
}
#phone {
width: 59px;
background-image: url(gfx/iconPhone.gif);
}
#phone a {
background-image: url(gfx/iconPhone.gif);
}
#phone a:hover {
background-position: 0 -50px;
}
Each one individually works, but I want to combine them into the same space.
Because I don't understand how to have both things be true (due, I think, to a lack of understanding of the namespace and inheritance), I currently am forced to have a TON of styles, one for every icon in each possible slot, like this:
Code:
/* PHONE in position 1 */
#iconphone1 {
position: absolute;
right:130px;
top:10px;
width:60px;
height:50px;
}
#iconphone1 a {
display: block;
padding-top: 50px; height: 0px !important;
height /**/: 50px; overflow: hidden;
}
#iconphone1 {
width: 59px;
background-image: url(gfx/iconPhone.gif);
}
#iconphone1 a {
background-image: url(gfx/iconPhone.gif);
}
#iconphone1 a:hover {
background-position: 0 -50px;
}
I assume there's some kind of thing I can do if my stylesheets are designed correctly where I can reference something like "icon1.phone" or "icon2.phone" or "icon1.calendar," etc., but I'm not sure how to do it.
I apologize in advance if this is a really dumb question, as I'm only just learning CSS and know I've got a lot to learn.