homepage Welcome to WebmasterWorld Guest from 54.211.95.201
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

    
Opera 7 does not display certain styles
Opera 7 isn't displaying selector styles from an external stylesheet
jimrockford




msg:1197692
 9:10 pm on Mar 18, 2003 (gmt 0)

Hi folks,

I finally got my page looking good in IE, NN and Opera, so I took out all the internal CSS and made a stylesheet. Now, Opera 7 doesn't display the selector styles from the external stylesheet.

Stuff like h1, h2, p and img work fine, but things like #header, #footer don't work at all.

Am I missing something from Opera's preferences?

 

DrDoc




msg:1197693
 9:28 pm on Mar 18, 2003 (gmt 0)

It should work...

Just remember that ID's can only be used for one element on the page since it's a unique identifier. If you need to style more than one element, use a class instead.

Other than that, it should work just fine.

DrDoc




msg:1197694
 9:40 pm on Mar 18, 2003 (gmt 0)

Also, make sure that you have declared type="text/css"...

jimrockford




msg:1197695
 9:57 pm on Mar 18, 2003 (gmt 0)

Thanks for that, but each id is unique and I've tried using both link and import (with absolute and relative uri's) and each one separately, but still no joy.


<link href="http://localhost/dunlopandlugton/dunlopandlugton.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
@import url("dunlopandlugton.css");
-->
</style>

Nick_W




msg:1197696
 10:01 pm on Mar 18, 2003 (gmt 0)

Try dropping the quotes from your @import Jim.

@import url(somestyles.css);

Nick

DrDoc




msg:1197697
 10:04 pm on Mar 18, 2003 (gmt 0)

No, the quotes aren't the problem .. it's the comment <!-- -->

I assume you're working on an XHTML page. According to the documentation a standards compliant browser is allowed to ignore anything inside of comments. Hence, never use comments as a method of "hiding from older browsers".

Remove the comments and it will work just fine ;)

Nick_W




msg:1197698
 10:05 pm on Mar 18, 2003 (gmt 0)

I never use them at all. I suspect Doc's right, he usually is!

As an aside, what's the definitive on those quotes?

Nick

DrDoc




msg:1197699
 10:09 pm on Mar 18, 2003 (gmt 0)

No quotes inside of parenthesis

background: url(img/blah.gif);

@import url(blah.css);

BUT

@import "blah.css";

Nick_W




msg:1197700
 10:29 pm on Mar 18, 2003 (gmt 0)

Yep, that's how I understood it. I just thought it might be either as you didn't mention it being correct/incorrect.

Cheers

Nick

DrDoc




msg:1197701
 10:40 pm on Mar 18, 2003 (gmt 0)

Well, I think the user agents are still supposed to render it correctly, and that it shouldn't matter. That's why I didn't mention it. But I can't find any information on the subject (and I'm trying to find a reference to the whole <!-- ->> thing too)
:(

DrDoc




msg:1197702
 10:43 pm on Mar 18, 2003 (gmt 0)

Aah! Found it! ;)

XHTML 1.0 [w3.org]
C.4. Embedded Style Sheets and Scripts
Use external style sheets if your style sheet uses < or & or ]]> or --. Use external scripts if your script uses < or & or ]]> or --. Note that XML parsers are permitted to silently remove the contents of comments. Therefore, the historical practice of "hiding" scripts and style sheets within "comments" to make the documents backward compatible is likely to not work as expected in XML-based user agents.

DrDoc




msg:1197703
 10:45 pm on Mar 18, 2003 (gmt 0)

Personally I like the way they call it historical practice ;)

Like you said, Nick... you never use comments, and there really is no need for them

jimrockford




msg:1197704
 8:19 am on Mar 19, 2003 (gmt 0)

Thanks Doc,

That was the problem. Got my nice layout back (for now anyway).

Jim.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved