SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Apr 2004
    Location
    The Netherlands
    Posts
    46
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Opera and @import

    Hello, I'm having some issues with @importing style sheets on Opera 7

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    	"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
    <head>
    <title>x</title>
    <style type="text/css" media="all">
    /* <![CDATA[ */
    	@import url(http://localhost/dev/css/file1.css);
    	@import url(http://localhost/dev/css/file2.css);
    /* ]]> */
    </style>
    In fact, it doesn't request the files from the server at all. Am I missing some code here?
    I've tried both absolute and relative URL's, with or without url(); single and double quotes or no quotes at all, with or without media type in the style element and @import rule, but nothing seems to work for Opera.

    It works fine on FF and IE

    edit: After some more testing I realised that serving as application/xhtml+xml and putting the rules in CDATA blocks, will cause Opera to ignore the @import.

    I guess I'll have to switch to link elements..
    Last edited by Sheqel; Feb 22, 2005 at 20:25.

  2. #2
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Since you're using XHTML, you could specify the style sheets like this:
    HTML Code:
    <?xml-stylesheet href="/dev/css/file1.css" media="all"?>
    <?xml-stylesheet href="/dev/css/file2.css" media="all"?>
    Birnam wood is come to Dunsinane


Bookmarks

Posting Permissions

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