Prev | Current Page 461 | Next

Craig Grannell

"The Essential Guide to CSS and HTML Web Design"

css");
/* ]]> */

This can be placed in the same style element as the import line for the clean style sheet:

For any other overrides, you need to resort to JavaScript, which isn??™t an ideal solution??”
after all, there are still plenty of people out there who routinely turn off JavaScript??”but
it??™s the best we??™ve got.
It??™s probably worth noting that zoom, like some of the other things mentioned in the
Internet Explorer fixes, will not validate. However, as far as I??™m concerned, there??™s no
real urgency or reason to make IE-specific style sheets validate. Keep your main style
sheet clean and valid, and then add whatever you need to get things working in
Internet Explorer??”although always use as few additions as possible, even when working
with conditional comments. In some cases, however, height: 1% should provide
the same effect, and this is valid CSS.
DEALING WITH BROWSER QUIRKS
367
9
For targeting a specific platform, you can use a script like this, added to an external
JavaScript file:
if (navigator.platform.indexOf('Mac')!= -1) {
var cssNode = document.createElement('link');
cssNode.setAttribute('rel', 'stylesheet');
cssNode.setAttribute('type', 'text/css');
cssNode.setAttribute('href', 'mac-hacks.css');
document.getElementsByTagName('head')[0].appendChild(cssNode);
}
In this case, if the user has a Mac, the style sheet mac-hacks.


Pages:
449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473