Now I’m getting closer to the goal of passing W3C CSS validation just by cleaning out the guru’s temporary comments that were not really valid, like “xwidth” and “*width”.
*width and _width are for when you’re targetting IE5.5 and below… first you use the Tan Hack to hit IE6 and below…
- html #element {
width: 200px;
padding: 0 20px; /in normal browsers, this means inner content area is 200px and total width of the box is 240px… but in IE5.5 and below, it’s total width is 200px and the inner area has shrunk by 40px…/
}
but you know IE6, when not in quirks mode, can deal with the “good” rules, so then you add the special rules to make IE6 act like every else:
- html #element {
width: 240px;
padding: 0 20px;
_width: 200px;
}
Now the boxes are the same for everyone… IF you are actually bothering for IE5. Most don’t, unless they know they have a client who is still using that browser. Yeah, it’s illegal according to the validator, but I’ve kept styles like that in my main stylesheet for the ctrl-f value : ) If you have a ton of styles like that, and still want to support IE5.5 and below, a separate stylesheet called with IE conditional comments is better.
- Everything can’t be !important. It’s easy for me to spot lines that my hired expert added to styles.css, because almost all of them end in !important. I guess he didn’t want to think too hard. I need a strategy for cleaning this up. Maybe I’ll take all of them out, and put my brain to work.
It’s considered bad form anyway, because while the original CSS specs said !important was for us (authors), since CSS2.1 it’s been given to users (user stylesheets can use !important to set their own styles to override author stylesheets). Since this use by users of !important is considered necessary for accessibility reasons (they may need whole differnt font-sizes, styles, higher-contrast colours, whatever), using it in your own author stylesheets is usually a no-no (there are exceptions, like getting arounf FF users with the Google Toolbar getting yellow-background form inputs).
Usually if the rule isn’t working without !important, you can just make it a hair more specific, or change where it is in the code flow (similar-level code who comes later overrides).
So, you are correct to try to remove these.
- A Java-based drop down menu probably isn’t a good idea. Earlier in this thread, Stomme poes showed us screenshots of the site with Java turned off. Since my goal is to eventually make this site mobile friendly, I think I have to switch to a CSS-based menu. That would cure some of the other cross-browser problems that my guru was using hacks to fix. I have lots of [if IE] sections that don’t validate and can probably be eliminated with thought and planning.
Careful, Java is a pedantic strongly-typed classical-inheritance back-end language used by all those kids who went to computer school to learn that uber-awesome JAVA!
Javascript is a loosely-typed prototypical (not class-based) front-end (client-side) language for all those who want jawsome fading-dancing-singing AJAX-FORM-VALIDATION LOLMIGAWD stuff : )
Okay I’m picking on it, it’s been way too abused, not really a bad language (just some bad stuff in it), but always be clear between the two languages because they’re quite different!
[edit] I actually didn’t look, is this a dropdown menu?? Lawlz, if not, ignore EVERYTHING about menus below this!! Plus, mobiles don’t like dropdowns anyways, because they often can’t :hover anyway!
Anyway, the menu I usually recommend is the Son of Suckerfish menu because the CSS is exceptionally clear… though it does have one little IE7 bug in it that you’ll only notice if you use something else besides the Suckerfish Javascript in the <head> of the document (there are only two ways I know of to get dropdowns working in IE6 without Javascript… and most people just use JS as the crutch for that crippled browser).
Though I’ve also used a version called Part Deux by Blake Haswell for extra keyboard-ability : )
It also has a bug in Gecko browsers and IE6 which is also fixable. Then there’s a small JS overlay that does both the crutch for IE6 AND makes the keyboarding experience way more awesome, plus a slight off-hover delay for those with shaky mice, so they don’t lose their dropdown because they went a pixel too far for a billionth of a second… which is nice. In general, more than two levels is getting closer to inaccessible for many, and I wouldn’t go as deep as Blake’s myself.
While Keyboarding through the dropdowns is cool and all, generally I would just make sure the main-level links are clickable (they go to some page where users can then reach everything that was inside the dropdown… because there’s always someone who can’t get the dropdown to drop down).
So, your HTML will be good and simple and the same, and the css can be as complicated or simple as you want. Dropdowns are a world of their own and they took me a while to “get”. You start out just copying one like Sons that works and then tweaking it from there, while later you “get” it and can just write your own out of your head. My one keyboardable Haswell version I still copy-pasta from the site I wrote it for just because the original took a lot of trial and error and I’m too lazy to go through that again (and forget about Opera! I couldn’t get that one to bring anything onscreen).
You can also read about dropdown accessibility and Mega dropdowns here:
http://www.useit.com/alertbox/20001112.html (try not to use them)
http://www.useit.com/alertbox/mega-dropdown-menus.html (megas are actually fairly user-friendly if you do it right)
And Tysson has a nice list (a bit old, but not outdated) of various dropdowns, all vying to be the Holy Grail of Dropdowns lawlz:
The DropDown Low Down
[/edit]
Lawlz or if you meant a plain ol’ regular menu, you can find good ones anywhere… and there’s a couple of ways to do it, just be aware of some IE bugs : )
: )
What do you think? Should I start new threads or keep this one?
Hm, dunno. I think for the dropdown menu itself edit IF it’s a dropdown, regular menus are peanuts! , if you need some handholding as you go through it, you’ll want to start a new thread specifically in the CSS section. For the rest… I suppose could go either way.