Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11

Thread: css problem

  1. #1
    Junior Member
    Join Date
    Apr 2004
    Posts
    14
    Member #
    5714
    Im wondering if its possible to have 2 stylesheets on one page, but only one is active untill a link is clicked and then it switches what sytlesheet it uses. So its like a theme/skin.
    ...

  2.  

  3. #2
    Senior Member glyakk's Avatar
    Join Date
    Nov 2003
    Location
    USA
    Posts
    1,263
    Member #
    3828
    Liked
    6 times
    Yes its possiable.. You would enable/disable the other style sheet(s) though some form of Javascript, php, asp, or other scripting/programming methode.


  4. #3
    Junior Member
    Join Date
    Apr 2004
    Posts
    14
    Member #
    5714
    Do you know of a good tutorial, which would teach me this?
    ...

  5. #4
    Senior Member glyakk's Avatar
    Join Date
    Nov 2003
    Location
    USA
    Posts
    1,263
    Member #
    3828
    Liked
    6 times
    there are tons of them out there. Do a quick google search. [searchweb]css switching[/searchweb]

    Here is an indepth one from A List Apart Alternative Style: Working with alternative style sheets


  6. #5
    Senior Member Brak's Avatar
    Join Date
    Apr 2003
    Location
    San Francisco, CA
    Posts
    3,413
    Member #
    1217
    Liked
    2 times
    Here's ALA's javascript tutorial, Here's their PHP switcher.
    Kyle Neath: Rockstar extraordinare
    The blog | The poetry site | The Spore site

  7. #6
    Senior Member karinne's Avatar
    Join Date
    Dec 2003
    Location
    Aylmer QC Canada
    Posts
    1,607
    Member #
    4335
    Liked
    8 times
    you can view the source of my karinne.net site... i use a styleswitcher with javascript

    these are my 3 stylesheets and the js
    Code:
    <link rel="stylesheet" type="text/css" href="http://www.karinne.net/css/green/display.css" />
    <link rel="alternate stylesheet" type="text/css" href="http://www.karinne.net/css/blue/display.css" title="blue" />
    <link rel="alternate stylesheet" type="text/css" href="http://www.karinne.net/css/red/display.css" title="red" />
    
    <script type="text/javascript" src="http://www.karinne.net/js/styleswitcher.js"></script>
    and this is the code (it creates little boxes with the color in them )
    Code:
    <a href="#" onclick="setActiveStyleSheet('', 1);return false;" title="Switch to default theme"><div style="width: 15px; height: 13px; background-color: #696; border: 1px solid #000; margin: 2px 5px 2px 0; float: left"></div></a>
    <a href="#" onclick="setActiveStyleSheet('blue', 1);return false;" title="Switch to blue theme" class="noline"><div style="width: 15px; height: 13px; background-color: #285577; border: 1px solid #000; margin: 2px 5px 2px 0; float: left"></div></a>
    <a href="#" onclick="setActiveStyleSheet('red', 1);return false;" title="Switch to red theme" class="noline"><div style="width: 15px; height: 13px; background-color: #d48e8e; border: 1px solid #000; margin: 2px 5px 2px 0; float: left"></div></a>
    all you gotta do now is copy the js i have and make you css and your ready to go

    hth
    [a web design portfolio - Currently NOT AVAILABLE for work | web design | Re-coding | PSD-to-HTML]
    I'm also on: virb - facebook - twitter - flickr - del.icio.us

  8. #7
    Junior Member
    Join Date
    Apr 2004
    Posts
    14
    Member #
    5714
    Thank you all very much, i really appreciate the help.
    ...

  9. #8
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    Be warned that by far, the more preferable solution is server-side. Absolutely never rely on a client-side script for critical functionality.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  10. #9
    Senior Member jlgosse's Avatar
    Join Date
    Jan 2004
    Location
    Newfoundland, Canada
    Posts
    1,037
    Member #
    4570
    Liked
    7 times
    The PHP way is pretty basic too, and you can store style information in COOKIES, or anything.

    You can even store user-chosen colors in a database, pull it out of the database when you log in, then store it in a cookie while you are logged in, keeping the styling you chose.

    Maybe I should do a tutorial on this topic, soon; for PHP.

    Maybe on how to have your own styling for a guestbook or personal blog, and how to select your favorite stylesheet, and continue using it, using PHP.


  11. #10
    Junior Member
    Join Date
    Apr 2004
    Posts
    14
    Member #
    5714
    Yhea great idea, you should do it for a blog tho :}
    ...


Page 1 of 2 1 2 LastLast

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 04:42 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com