Using the LINK Element with a MEDIA Attribute

Another way to block out certain browsers is to link to an external style sheet using the LINK element with a MEDIA attribute, like this:

<link href="hide3.css" type="text/css" rel="stylesheet" media="all">

Use this to block Netscape Navigator 4.x (all platforms) from accessing the specified style sheet. Netscape Navigator 4.x ignores any linked style sheet with a MEDIA value other than “screen” (media="screen"). Here's another version:

<link rel="stylesheet" href="mystyles1.css" type="text/css" media="screen,
projection" title="My #1 Style Sheet">

Get Cascading Style Sheets (CSS) by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.