I'm re-making my website, again, but this time I'm making sure it holds up to validation standards, and working almost entirely with CSS.
Meaning, all pages refer to one css file, and the html markup and tags should be identical on every page, with only the text content being different.
But I'm sure you knew that.
Anyway, I have a link bar. This link bar is full of Div's, and each div is a box that's a link taking you to a different page. The background of these div links is set up all in css.
Eh, I'll just give you the code..
Html:
<div id="links_wrapper">
<div id="link_home"><a href="index.html">Home</a></div>
<div id="link_about"><a href="about.html">About</a></div>
<div id="link_audio"><a href="audio.html">Audio & Scores</a></div>
<div id="link_video"><a href="video">Video</a></div>
<div id="link_contact"><a href="contact">Contact</a></div>
</div>
Here is the CSS for the wrapper and just ONE of the link divs:
(the background color is just in case there's lag loading the background image, to avoid ugly color clashes before it's done loading.)
(i.e. the background image is the entire size of the div, if you needed to know that.)
#links_wrapper {
height: 24px;
width: 780px;
margin: 2px auto;
}
#link_home {
background: #081472;
background-image: url(images/button_home.png);
background-repeat: no-repeat;
float: left;
height: 24px;
width: 154px;
margin-left: 1px;
text-indent: -9999px;
}
#links_wrapper a {
display: block;
width: 100%;
height: 100%;
text-decoration: none;
}
#links_wrapper a:hover {
background: #00b060;
filter:alpha(opacity=50);
-moz-opacity:0.5;
-khtml-opacity: 0.5;
opacity: 0.5;
}
My question is this: Is there some CSS psuedo class element or whatever that will look at the html file name and change background accordingly?
Like, when it's on index.html, the background of #link_home is different.
Or, more clearly, when you're viewing about.html, the background of #link_about is different.
You know, to reflect to the website user what page you're currently on, aside from just using header text or html title text of stuff like that.
I figured I'd ask here, since you guy are usually pretty awesome with this kind of stuff.
But if you don't know, don't sweat it, I'll ask someone here at the university if they know.