CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   XML (http://www.codingforums.com/forumdisplay.php?f=3)
-   -   linking to an external CSS file (http://www.codingforums.com/showthread.php?t=5277)

johnmayer 08-31-2002 09:39 AM

linking to an external CSS file
 
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.
Code:

<?xml-stylesheet href="css/test.css" type="text/css"?>
Should I stick with <link> ?

MCookie 08-31-2002 11:04 AM

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

jkd 08-31-2002 03:10 PM

That is the correct way, and works fine in IE5+, Mozilla, and Opera.

mpjbrennan 08-31-2002 05: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 09: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 10:14 PM

Yeah I figured that out. .xml supports <?xml-stylesheet ?> where .htm wont


All times are GMT +1. The time now is 09:51 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.