Results 1 to 6 of 6

Thread: change the colour of website...

  1. #1
    Join Date
    May 2006
    Posts
    266
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default change the colour of website...

    hi i wanted to know is there away with CSS i can do the following

    i have 3 different website templates they all look the same just the colours of the text and images are different, can i use CSS to show this these are background images by the way does this work with css so when a person click on red it goes to the ed template or blue template etc.

    Thanks

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    I think you mean how to switch between stylesheets. It is possible, yes.
    Code:
    function switchStyle(cssFile) {
      var ss = null;
      for(var i = 0, e = document.getElementsByTagName("head")[0].getElementsByTagName("link"); i < e.length; i++)
        if(e[i].rel === "stylesheet")
          ss = e[i];
      if(ss === null)
        document.createElement("style");
      ss.rel = "stylesheet";
      ss.type = "text/css";
      ss.href = cssFile;
    }
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    May 2006
    Posts
    266
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    so how do i make it look like MSN sorry if that don't make sence but when you click on an image it changes colours how would i do that.

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    As a background image:
    Code:
    <div style="background-image: url(green.png);" onclick="this.style.backgroundImage = this.style.backgroundImage.replace(/green/g, 'blue');">
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #5
    Join Date
    May 2006
    Posts
    266
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    sorry but i don't under stand so this is how i think i will do it, make 4 css page and 4 index pages. that should work right?

  6. #6
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    You only need one index page and four CSS files. That's the point of CSS.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

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