This is a bit trickier...at least for me and my limited understanding.
I'm using CSS buttons for my index page, the big buttons in the center, in a vertical list. When I originally wrote (actually modified someone else's) code for the buttons, I used the ID attribute:
for the buttons. Unfortunately, because there is text beneath each button, and there are several dozen buttons on the page, I'm repeating ID tags throughout the page -- not proper, as I understand it. Here's a truncated version of the HTML:Code:#buttonmenu { margin-left: 10px; } #buttonmenu ul, #buttonmenu li { margin: 0; padding: 0; list-style-type: none; list-style-image:none; } #buttonmenu a { display: block; width: 115px; padding: 8px; margin: 0; border: 5px outset #7ac7fe; background-image: url('http://www.iraqtimeline.com/graphics/bluemottle.jpg'); color: white; text-align: center; font-weight: bold; font-family: Trebuchet, Verdana, Arial, sans-serif; } #buttonmenu a:hover { position: relative; border: 5px inset #7ac7fe; background-image: url('http://www.iraqtimeline.com/graphics/bluemottle.jpg'); color: white; font-weight: bold; font-family: Trebuchet, Verdana, Arial, sans-serif; }
It actually displays properly in FF, IE6, and Opera, but I'd like to be valid, and I don't know what it looks like in IE7, Mac IE, Safari, or Konq, much less other browsers.Code:<div id="buttonmenu"> <ul> <li><a href="1897.html">1897-1960</a></li> <li>...text here...</li> </ul> </div> <div id="buttonmenu"> <ul> <li><a href="1961.html">1961-1970</a></li> <li>...text here...</li> </ul> </div> ...and repeat
So I tested a change, making the CSS for the buttonmenu a class instead of an ID:
and changing the div ID in the HTML to div class:Code:.buttonmenu and so forth
Problem is, in IE6 the text links in the buttons themselves no longer appear in white, as mandated in the CSS code, but in the overall link colors:Code:<div class="buttonmenu">
(I didn't test it in FF or Opera, since the problem showed up in IE6, and the majority of my site's visitors use some version of IE, more's the pity.)Code:A:link { color: #0000ff; text-decoration: none; ...and so forth... }
Obviously, I'm running into a problem with the cascading part of CSS, with the original link CSS overriding the buttonmenu style commands. It doesn't happen with the ID tag, but it does with the class tag.
Here is the link to the stylesheet, if you're interested.
Any ideas?






)



Bookmarks