Welcome to WebmasterWorld Guest from 184.72.138.255

Forum Moderators: open

Message Too Old, No Replies

opera not recognising CSS stylesheet

     
7:02 pm on Aug 4, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 12, 2006
posts:2493
votes: 22


got a real annoying problem that i've only just discovered. if i view my site in opera it appears as a totally unstyled page, as if there is no stylesheet at all.

every other browser i've tried (firefox, IE, chrome, safari) is fine. and the stylesheet is definitely there. i can even link to the stylesheet in opera and get it to display all the rules. it just won't act on them.

the only thing that i can think of is the fact that it has a .php extension rather than .css.
but it's served with the correct header and mime-type is okay, and every other browser recognises it okay, so i can't see why that would be an issue.

i'm stumped. anyone had any similar problems with opera?
2:05 am on Aug 6, 2010 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Sept 21, 2002
posts:729
votes: 8


Has both the page and css ben run thru a validator? Opera is very strict in its standards interpretation. Does the link to the stylsheet have media="screen" rel="stylesheet" type="text/css ?

Is the page and css both served as the same type (ANSI/UTF-8)?

Beyond this a wild guess of what might help, have a look at Dynamic Cascading Style Sheets [en.wikipedia.org ]
2:14 am on Aug 6, 2010 (gmt 0)

Preferred Member

10+ Year Member

joined:Apr 14, 2003
posts:438
votes: 0


The only times I have problems with opera stylesheets using php is when the server header is incorrect. Is the header set as Content-type: text/css?
1:53 am on Aug 7, 2010 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Sept 21, 2002
posts:729
votes: 8


+1 to outrun's suggestion. Worth a check IMHO.
8:39 am on Aug 7, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 12, 2006
posts:2493
votes: 22


this is what i've got at the top of the php (css) file

header("Content-type: text/css; charset:UTF-8");


and when i look at the response headers it says
Content-Type: text/css;charset: UTF-8

so that looks alright

this is how i call it from the html
<link rel="stylesheet" type="text/css" media="all" href="example.php">

cant see anything wrong with that
7:22 am on Aug 12, 2010 (gmt 0)

Junior Member

5+ Year Member

joined:Nov 16, 2006
posts:64
votes: 0


Are you sure the stylesheet is really encoded with utf8 ? No BOMs at the beginning of it or some such? Are you sure no other data is output first? Do you have a link I can look at?
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members