homepage Welcome to WebmasterWorld Guest from 50.16.112.199
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

10+ Year Member



 
Msg#: 766 posted 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

WebmasterWorld Senior Member drdoc us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 766 posted 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

WebmasterWorld Senior Member drdoc us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 766 posted 9:40 pm on Mar 18, 2003 (gmt 0)

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

jimrockford

10+ Year Member



 
Msg#: 766 posted 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

WebmasterWorld Senior Member nick_w us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 766 posted 10:01 pm on Mar 18, 2003 (gmt 0)

Try dropping the quotes from your @import Jim.

@import url(somestyles.css);

Nick

DrDoc

WebmasterWorld Senior Member drdoc us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 766 posted 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

WebmasterWorld Senior Member nick_w us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 766 posted 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

WebmasterWorld Senior Member drdoc us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 766 posted 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

WebmasterWorld Senior Member nick_w us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 766 posted 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

WebmasterWorld Senior Member drdoc us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 766 posted 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

WebmasterWorld Senior Member drdoc us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 766 posted 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

WebmasterWorld Senior Member drdoc us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 766 posted 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

10+ Year Member



 
Msg#: 766 posted 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