470,591 Members | 1,446 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,591 developers. It's quick & easy.

Customized CSS

Hi. I have a web site that allows the user to customize the cascading style
sheet they want to use. Every htm page starts with:

<link href="print.css" media="print" rel="STYLESHEET" title="main"
type="text/css">
<link href="main.css" media="screen" rel="STYLESHEET" title="main"
type="text/css">
<script LANGUAGE="JavaScript" TYPE="text/javascript">
<!-- Beginning of JavaScript -------------------
//
// main style sheet
//
if (typeof(top.topcss) == "string" && top.topcss != "") {
document.write('<link href="'+top.topcss+'.css" rel="STYLESHEET"
media="screen" title="main" type="text\/css">')
}

This scheme seems compatible with eariler browsers. The user can select
from a variety of style sheets, yet still be able to print any given page.
Now I've just tried with with Opera 7.23, doesn't work. No matter what
top.topcss is set to, the screen style sheet remains at main.css.

I'm thinking I'll need to activate the top.topcss sheet somehow. Any advice
would be appreciated...Dennis
Jul 20 '05 #1
2 1099
I figured out my own problem. top.topcss was empty. I was using a
document.stylesheets test, which in Opera returns false. If Opera can do
style sheets, what would be a good test?
Jul 20 '05 #2
On Sat, 7 Feb 2004 17:49:23 -0500, Dennis Allen <de****@dennisallen.com>
wrote:
I figured out my own problem. top.topcss was empty. I was using a
document.stylesheets test, which in Opera returns false. If Opera can do
style sheets, what would be a good test?


Opera has excellent style sheet support. What you are trying to achieve is
supported natively: Opera users are able to select alternative style
sheets from a menu in the browser. Mozilla, and I assume Netscape, support
this, too. IE, and possibly Konquerer, are the only browsers I've used
that don't allow style sheet selection.

Mike

--
Michael Winter
M.******@blueyonder.co.invalid (replace ".invalid" with ".uk" to reply)
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Jean Bredeche | last post: by
reply views Thread by Chris | last post: by
reply views Thread by TIBM | last post: by
reply views Thread by segal.aviad | last post: by
3 posts views Thread by wolfgang.lipp | last post: by
7 posts views Thread by SteveT | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.