Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Aug 2002
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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> ?

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    NL
    Posts
    421
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #3
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    That is the correct way, and works fine in IE5+, Mozilla, and Opera.

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Location
    Newcastle, England
    Posts
    178
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The <?xml-stylesheet?> processing instruction was intended to be only a temporary measure (though it appears to be still current).

    patrick
    Last edited by mpjbrennan; 09-01-2002 at 10:11 AM.

  • #5
    Moderator
    Join Date
    May 2002
    Location
    Hayward, CA
    Posts
    1,460
    Thanks
    1
    Thanked 23 Times in 21 Posts
    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 ?>.
    "The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
    June 30, 2001
    author, Verbosio prototype XML Editor
    author, JavaScript Developer's Dictionary
    https://alexvincent.us/blog

  • #6
    New to the CF scene
    Join Date
    Aug 2002
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yeah I figured that out. .xml supports <?xml-stylesheet ?> where .htm wont


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •