The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Web Page using wrong .css file

Hi all!

I've got a page that's using 2 style sheets - one for screen & one for print. Problem is, for some wierd reason the site is using the print style sheet for the screen. Here's the code that calls both style sheets:

You can also use this if you want to use a style sheet that applies to both layouts:

Code:

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

ZOO

Thanks for the fast replies!

The problem occured on IE 5.5 sp2, Windows 98.

I had used your suggestion, Zoo, the first time I tried this. I also had a black & white version of the logo that wasn't displayed, except for the print version. NN 4.x would show both versions of the logo anyway.

Personally, I'd love to forget about NN 4.x, but the site is for a non-profit, so their stats show NN 4.x as the largest # of Netscape users. Granted, that # isn't that high anyway, but I wouldn't want to shut anyone out.

Edit: seen as redux beat me too it, you might want to try his method. I choose to take the easy way out of problems like this and write compliant code (if users can't be bothered to update their browsers it's not my problem ), so I haven't experimented with cross-browser compatibility.

That's also a convenient way of hiding styles from IE, if memory serves. ;-)

I think redux has the "better" solution for this situation even though (again from memory) NS4 can't handle @media. Plus, it cuts down on the number of style sheets you have to load and keep track of. It also allows you to easily have a base style and have media-dependent styles inherit from that. :-)

That's also a convenient way of hiding styles from IE, if memory serves. ;-)

I think redux has the "better" solution for this situation even though (again from memory) NS4 can't handle @media. Plus, it cuts down on the number of style sheets you have to load and keep track of. It also allows you to easily have a base style and have media-dependent styles inherit from that. :-)

~~Ian

1) Didn't know that - I'll have to look into it!

2) Probably true, I tend only to use 2 sheets. A very simple print one and a much more complex display sheet. As the display sheet is the only one to change on a regular basis it makes sense for me to have 2 style-sheets, however I guess its worth playing around to see what works best for your own site.

hmm, perhaps I should just stick to back-end things, I'm not much cop at this design rubbish

hmm, perhaps I should just stick to back-end things, I'm not much cop at this design rubbish

Pah! I quoted better for a reason, y' know. ;-)

If you're going to make a bunch of alternative styles available on your site, but you want to create a consistent look 'n' feel across 'em, a few li'le @imports might make it easer to share code across the different styles (using the "cascade" to overwrite the sections you need to)--module like & all that. I'd still use @media for most media-dependent styles where needs be, though--partly 'cause o' IE, and partly just preference. :-)