Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: Customized CSS

  1. #1
    New Coder
    Join Date
    Jun 2002
    Posts
    70
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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

  • #2
    New Coder
    Join Date
    Jan 2004
    Location
    South of France
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hi dallen24

    this might help :

    crossbrowser style switcher

    does it ?

  • #3
    New Coder
    Join Date
    Jun 2002
    Posts
    70
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Useful web site.

    I figured out my own problem. top.topcss was empty. In my index.htm I had a document.stylesheets test, which in Opera returns false. If Opera can do style sheets, what would be a good test?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •