Search Engine Optimization > Web Development > Correct way to link to a style sheet
Correct way to link to a style sheet
Posted by Gordon Hudson on June 22nd, 2004



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


or


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


Does it matter?

Gordon


Posted by Geoff Berrow on June 22nd, 2004

I noticed that Message-ID: <40d8812c$0$58823$5a6aecb4@news.aaisp.net.uk>
from Gordon Hudson contained the following:

Yup. @import hides the CSS from older browsers. This is a good thing.

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/

Posted by Barry Pearson on June 22nd, 2004

Geoff Berrow wrote:
You can also @import from the start of the stylesheet identified from <link
..... >. That enables you to put the hiding into the CSS, and not make it an
HTML issue.

--
Barry Pearson
http://www.Barry.Pearson.name/photography/
http://www.BirdsAndAnimals.info/
http://www.ChildSupportAnalysis.co.uk/



Posted by Gordon Hudson on June 22nd, 2004


"Geoff Berrow" <blthecat@ckdog.co.uk> wrote in message
news:ld1hd0ttaj1dh29j6jvjkiu7uuisndd8j9@4ax.com...
Thanks both.
I will use @import although at thsi rate it will be Christmas before its
finished and I started it last October.

What is it they say about the painters house or the cobblers children?



Posted by Pete Gray on June 23rd, 2004

In article <40d893e8$0$58819$5a6aecb4@news.aaisp.net.uk>,
gordon@usenet.hostroute.co.uk says...
But beware! IE4 does understand:
@import url("text.css");
as I found to my cost, but can really screw up the css. Fortunately,
it _doesn't_ understand this:
@import "text.css";

I don't think you need to bother with the comments around it either.

Pete
--
Pete Gray
while ($cat!="home"){$mice=="play";}

Funbolt.com - Entertainment portal, wallpapers, sexy celebs