Welcome to WebmasterWorld Guest from 54.159.26.69

Forum Moderators: not2easy

Message Too Old, No Replies

Opera 7 does not display certain styles

Opera 7 isn't displaying selector styles from an external stylesheet

     

jimrockford

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

10+ Year Member



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

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

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



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

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

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



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

jimrockford

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

10+ Year Member



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

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

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



Try dropping the quotes from your @import Jim.

@import url(somestyles.css);

Nick

DrDoc

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

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



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

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

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



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

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

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



No quotes inside of parenthesis

background: url(img/blah.gif);

@import url(blah.css);

BUT

@import "blah.css";

Nick_W

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

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



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

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

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



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

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

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



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

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

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



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

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

10+ Year Member



Thanks Doc,

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

Jim.

 

Featured Threads

Hot Threads This Week

Hot Threads This Month