+ Reply to Thread
Results 1 to 7 of 7

Thread: Different image per style sheet

  1. #1
    InsanityOnline is offline x10Hosting Member InsanityOnline is an unknown quantity at this point
    Join Date
    Nov 2007
    Posts
    30

    Different image per style sheet

    Ummm. is there any way I can set an image to change based on a css style sheet?

    Like say I wanted my main site logo to be the google logo on style sheet 1, and to be the yahoo logo on style sheet 2. How could I do this?
    Last edited by InsanityOnline; 12-23-2007 at 02:02 PM.

  2. #2
    Jesse's Avatar
    Jesse is offline Lord Of The Keys Jesse is an unknown quantity at this point
    Join Date
    Oct 2007
    Location
    Manila, PH
    Posts
    1,357

    Re: Different image per style sheet

    I think you could use layers in photoshop?
    x10HOSTING
    Member Since October 2007.

    JESSEMAN.ME
    | iMusicz.net

  3. #3
    Penguin129's Avatar
    Penguin129 is offline x10Hosting Member Penguin129 is an unknown quantity at this point
    Join Date
    Aug 2007
    Posts
    68

    Re: Different image per style sheet

    I'm not sure if you can change an <img> tag's image using css, but if you used a <div> or similar then you can. Let's say that both images are 100x100 pixels,
    Code:
    <div class="image"></div>
    Stylesheet 1
    Code:
    div.image {
      background-image: url('image1.png');
      height: 100px;
      width: 100px;
    }
    Stylesheet 2
    Code:
    div.image {
      background-image: url('image2.png');
      height: 100px;
      width: 100px;
    }
    Something like that should work.

  4. #4
    InsanityOnline is offline x10Hosting Member InsanityOnline is an unknown quantity at this point
    Join Date
    Nov 2007
    Posts
    30

    Re: Different image per style sheet

    I used p.class combined with display:none.

    kind of redundant but it works well.

  5. #5
    curt15's Avatar
    curt15 is offline x10Hosting Member curt15 is an unknown quantity at this point
    Join Date
    Jul 2007
    Posts
    96

    Re: Different image per style sheet

    You can use a small block of PHP to randomly select an image.

  6. #6
    Penguin129's Avatar
    Penguin129 is offline x10Hosting Member Penguin129 is an unknown quantity at this point
    Join Date
    Aug 2007
    Posts
    68

    Re: Different image per style sheet

    Except he wanted it in css, not php.

  7. #7
    curt15's Avatar
    curt15 is offline x10Hosting Member curt15 is an unknown quantity at this point
    Join Date
    Jul 2007
    Posts
    96

    Re: Different image per style sheet

    You can make a PHP stylesheet, makes it easier when you want to change colours, but you write it using CSS.

+ Reply to Thread

Similar Threads

  1. Looking for a free pdf to image converter
    By Christopher in forum Off Topic
    Replies: 8
    Last Post: 01-11-2007, 03:50 PM
  2. Replies: 1
    Last Post: 11-04-2006, 06:49 PM
  3. Homepage image 200 points!!
    By __z|x__ in forum The Marketplace
    Replies: 3
    Last Post: 06-13-2006, 06:27 PM
  4. errors while attaching
    By mattspec in forum Feedback and Suggestions
    Replies: 0
    Last Post: 12-19-2005, 01:50 PM
  5. November Desktop
    By n4tec in forum Off Topic
    Replies: 12
    Last Post: 11-08-2005, 07:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers