Nearly Hack-Free CSS
This “nearly hack-free” means of authoring provides authors the freedom to write clean, valid external CSS1 style sheets to be read and compatibly understood by the few browsers that do so. Only you can decide when you are comfortable letting non-compliant browsers eat unstyled markup. — Tantek Çelik
Wow. Vastly more elegant than using @import to hide from NN4.x and then using his box model hack to get around IE5.x/Win problems, but I’m afraid I’ll have to file it away for a little while. I’m not quite ready to class IE5.x/Win with the browsers that don’t deserve anything but unstyled <h1>s. Yet.
[via mark]
I don’t know, Phil. Maybe you should give it a shot. I come to your page and I see this. At first, I thought that it was a creative way of telling us that the only hack-free CSS is no CSS :)
That would have been much funnier. Alas, I’m a man of many words, not few.
Is that by any chance IE6 you are using? There’s a CSS bug in IE6, rather like the much more famous ALA scrolling bug, where sometimes, some links will make their entire parent disappear. I can usually fix it by either selecting and then deselecting the affected text, or doing the ALA fix of F11 twice. I’ve seen it on half a dozen other sites, and couldn’t find anything clearly the same in their CSS and mine, that might be the culprit, so I’m just hoping for a service pack release that fixes it. Yeah, I could just redesign the whole thing, but I’m lazy. And uninspired. And lazy.
Yeah, I’m using IE6. I should have known it was Microsoft’s fault. Strange that I’ve never seen the ALA scrolling bug before, only the Phil Ringnalda text bug :) It’s not a big deal for me, because I like to highlight text as I read it anyway.
The scrolling bug is a tough one to catch. I’ve had my best luck with an empty cache, starting to scroll while the page is still loading. But I’m starting to wonder if ALA is really a secret project to discourage the use of CSS: look at the current article on CSS rollovers: for me, in IE6 the buttons start out centered in the containing frame, but jump to the left on the first rollover. In Mozilla 0.9.8 and Opera 6, they just look like crap: the transparency and the rollover color don’t match the button frame at all, so it looks like a little kid who can’t color inside the lines. I don’t have a Mac, and can’t be arsed to fire up my IE5/Win machine to see if it actually works on either of those, but I’d say if you have a technique that doesn’t work right in IE6/Win, Mozilla 0.9.8/Win, or Opera 6/Win, you’ve got a technique that isn’t ready for use, no matter how valid the code is.
”highlight text as I read” – hey, is that you that keeps doing that in my library books?
Please Help…!!!!!!!!!!
I Need Some Utilities To Show My Invisible To Visible In Yahoo Messenger.
tankhs…:)!!
Do you mean that you want to be able to see that your Friends are online, even when they are logged in Invisible? That would be immoral, and impolite, and illegal, since you would have to crack the YIM server to get it to tell you about people who are Invisible. No.
Party pooper.
i need to know that who yahoo user is talking with and what he is talking about?could u help me plz?
hello
Y The Hell Did `Invisible` Say Party Pooper? YOU MORON
why would someone ask for help with YIM in a CSS question forum anyway?
I was thinking about going CSS. BUT — and it is a big but… I worry about it since there are still people out there who do not have the newer browsers. Shold I say screw-em all and go for it -or is it not worth it – ?
Like most things, whether or not you should switch to CSS depends…
If you have a lot of pages that you want to have look the same, especially non-blog pages (since you can make a single change to your blog template and have it affect all your blog pages nearly instantly, CSS or not), you might prefer CSS
If you change your layout more often than you change your socks, and hate having to wait while every archive page regenerates, you might prefer CSS
If you have a complicated design, with lots of nested tables, and a slow dialup connection, you might prefer CSS
But…
If you don’t like spending lots of time tweaking things, finding a way around this bug in this browser only to have to find a way around another bug in another browser, you might not prefer CSS
Since support for CSS varies a lot more by browser and operating system than support for tables and fonts, if you only have access to one browser on one operating system, you might not prefer CSS
Most of the time, I like it just fine, but there are times, doing things like trying to have a column of form labels aligned right, next to a column of form inputs aligned left, when it’s a horrible temptation to just throw in a table that I know without checking will work in almost every browser.
Why all the ”how does I show my Yahoo invisibles?” questions? That’s the Google tax for showing referrers and having comments indexed: the post title pulled in someone looking for ”free CSS” (who would charge for CSS?) on Yahoo, and once their referral was indexed that got someone searching for ”hack yahoo messenger” (despite not having the word messenger at all at the time), and so now I’m ranked as a good resource for things that are mostly found in the query string from previous searches. There must be some sort of lesson there, but I’m not sure what it is (maybe ”I need to work harder at filtering searches out in my referral script”).
please create me an illegal id in yahoo messenger ”_sadra_” .
tanks.
this seems to work so far, would you consider it an acceptable fix for the IE6 CSS scrolling problem?
sorry, didn’t preview, here’s the proposed CSS / IE6 fix:
<script type=”text/javascript”>
function resizeWindow()
{
top.resizeBy(0,-1);top.resizeBy(0,1)
}
</script>
<body onLoad=”resizeWindow()”>
I think it depends on what matters more to you: having IE6 render in standards mode, or fixing it for people with javascript disabled. If you don’t need IE6 to be in standards mode, just use an XML declaration: the <?xml version=’1.0’ encoding=’iso-8859-1’?> at the start of my main page does a fine job of making the page scrollable in IE6, with or without javascript, at the cost of throwing IE6 into quirks mode (Gecko stays in standards mode). If you are doing something that requires IE6’s standards mode, then you’re better off going with the script solution (and I’d guess that a fair number of the people who are savvy enough to surf with javascript disabled are also aware of the F11-twice fix, so they can handle taking care of it themselves).
But really, there’s no better solution I’ve found than Phoenix. The only thing I miss from IE is the ”email this page/email a link” menu item, about once every two weeks. When I have to go back to IE, I miss all sorts of things from Phoenix, constantly.
thanks for the advice, I’d gone as far as setting browser recognition to avoid a real bastard of a looping problem with the netscape browser resize fix.
It’s good practice, but i’m sure your way is better.
is there a way to exclude styles from part of a css-linked html page?
reason: in Netscape 4, when tables of image slices have font-styled td tags, the cells get extra top and bottom padding. i want to keep the td style from affecting this type of table but not the rest of the page.
Well, my favorite way of hiding things from ancient versions of Netscape is just to use @import. If you want NN4 to have, whatever, a 1px dashed border around TDs, but not font styling, if you say
where no_netscape.css includes stuff like
TD {font-size: 1.1em}
(without any style tags, since it gets treated as though it appears in the page where the @import is), then NN4 won’t see the no_netscape.css stuff at all, but everything else will.