Skip to Content

Stylegala Forums » Forums list » Problem solving

@import rule not recognized?

@import rule not recognized?

post new topic Post new topic    Reply to topic Reply to topic

Author Message
sarbear

New member
  • Joined: 29 Sep 2004
  • Posts: 12
  • Location: Utah
  • Status: Offline
Reply with quote Post Posted: Wed Feb 08, 2006 22:02
I am wondering if anyone has encountered this before.

On a website I am linking to a stylesheet then importing an advanced stylesheet to hide it from older browsers.

A customer could not see the styles at all no matter what browser or platform they were on. She said they tried it in IE, Mozilla, Firefox and on XP, XP Pro and even Windows 98. On all of them the browser showed the website without styles.

We changed the set up so it linked directly to the advanced styles page and it worked fine.

What gives? I thought the @import rule would always work. Is there some sort of local setting, firewall, or network something that could mess this up? I am worried about using this method if this can happen more often than this one case.

View user's profile Send private message Visit poster's website
 
Sponsor
 
Lost_User

  • Joined: 22 Jun 2006
  • Posts: 0
  • Status: Offline
Reply with quote Post Posted: Wed Feb 08, 2006 22:18
code example?

View user's profile Send private message
 
sarbear

New member
  • Joined: 29 Sep 2004
  • Posts: 12
  • Location: Utah
  • Status: Offline
Reply with quote Post Posted: Wed Feb 08, 2006 22:27
Pretty basic import...

This is in the html:

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

and this is in main.css:
@import url(adv_styles.css);

All of the styles are in adv_styles.css. The customer couldn't see any of the styles in this set up.

It worked fine for the customer when we made the link point to a stylesheet with the styles in it.

View user's profile Send private message Visit poster's website
 
Lost_User

  • Joined: 22 Jun 2006
  • Posts: 0
  • Status: Offline
Reply with quote Post Posted: Thu Feb 09, 2006 00:32
sarbear wrote:
Pretty basic import...

This is in the html:

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

and this is in main.css:
@import url(adv_styles.css);

All of the styles are in adv_styles.css. The customer couldn't see any of the styles in this set up.

It worked fine for the customer when we made the link point to a stylesheet with the styles in it.


main.css:

@import "adv_styles.css";

The above will import styles for all browsers including even IE5MAC but not eg Netscape 4, IE 4

would add media attribute:

<link rel="stylesheet" type="text/css" href="main.css" media="screen, projection">

XHTML:

<link rel="stylesheet" type="text/css" href="main.css" media="screen, projection" />

also put stylesheets in a seperate folder eg *styles*

View user's profile Send private message
 
sarbear

New member
  • Joined: 29 Sep 2004
  • Posts: 12
  • Location: Utah
  • Status: Offline
Reply with quote Post Posted: Fri Feb 10, 2006 23:55
I'm not sure what your suggestions would be doing to make sure the import in the main.css file worked. The customer was able to see the linked style sheet but not the imported one in all of the modern browsers.

I am wondering if anyone has ever encountered this before. Maybe there is some sort of caching or local browser setting.

Any ideas?

View user's profile Send private message Visit poster's website
 

Page 1 of 1

post new topic Post new topic    Reply to topic Reply to topic

Display posts from previous:   

Powered by phpBB. © 2001, 2006 phpBB Group & Logo Design