View Full Version : linking to an external CSS file
johnmayer
08-31-2002, 10:39 AM
I read on W3.org that this is the proper way to link to an external CSS file in XML and XHTML, yet it does not seem to work.
<?xml-stylesheet href="css/test.css" type="text/css"?>
Should I stick with <link> ?
MCookie
08-31-2002, 12:04 PM
Hi,
don't know about XML, but on my XHTML pages I use either this:
<style type="text/css" media="all">@import "/style.css";</style>
or this:
<link rel="stylesheet" media="all" href="/style.css" type="text/css" />
to link to css files
That is the correct way, and works fine in IE5+, Mozilla, and Opera.
mpjbrennan
08-31-2002, 06:45 PM
The <?xml-stylesheet?> processing instruction was intended to be only a temporary measure (though it appears to be still current).
patrick
Alex Vincent
09-01-2002, 10:34 PM
John, do you have a testpage you can show us?
The mime-type may be affecting it a great deal. For instance, an XHTML file served as text/html will not process stylesheets from <?xml-stylesheet ?>.
johnmayer
09-03-2002, 11:14 PM
Yeah I figured that out. .xml supports <?xml-stylesheet ?> where .htm wont
vBulletin® v3.8.2, Copyright ©2000-2009, Jelsoft Enterprises Ltd.