Forum Moderators: not2easy

Message Too Old, No Replies

Which way is best to send to separate style sheet

LINK rel=stylesheet or @import url

         

annej

9:09 pm on Jan 29, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Each of my pages has these codes to two different style sheets in these two ways.

LINK rel=stylesheet type="text/css" HREF="name.css>

and

<style type="text/css"> @import url("aqhhomepage.css"); </style>

I think it might be slowing down my pages so I want to put it all on one style sheet.

This is what happens when you do a bunch of css then leave it for two years. I don't have a clue what I was thinkig at the time I set this up. I'm going to keep up on CSS better from now on.

Span

9:21 pm on Jan 29, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I started using @import many years ago because NN4 didn't understand it. Still use it. Don't know why. Got used to it.

<style type="text/css" media="all">
@import "style.css";
</style>

MWpro

11:27 pm on Jan 29, 2006 (gmt 0)

10+ Year Member



I would stick with the link tag.

I started using @import many years ago because NN4 didn't understand it.

If you don't want NN4 or any earlier browsers to read your CSS, just simply add the media tag to the end, I do this for all of my pages:

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

The older ones don't understand the media attribute and won't read the style sheet at all. Of course though, who cares about NN4 anymore?

annej

5:11 pm on Jan 30, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have tried using just the

LINK rel=stylesheet type="text/css" HREF="name.css>

on several pages and there seems to be a slight delay before the background comes up.

But when I also have

<style type="text/css"> @import url("morestuff.css"); </style>

I don't get the delay.

This is in my LINK style sheet.

body {
background-color: #FFFFF0;
background-image:url(background.gif);
font-family: Arial;
color: #330000;
}

So I can't understand why the the

@import url("morestuff.css")

helps something from the other style sheed come up faster.

added - I gave up on netscape 4 long ago.

annej

7:52 am on Feb 1, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Can anyone explain this?