Results 1 to 5 of 5

Thread: CSS image replacement code

  1. #1
    Join Date
    Jan 2019
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default CSS image replacement code

    Hello,

    I installed Dynamic Drive's CSS based image replacement code.

    It functions - but -

    I am having trouble figuring out which CSS instruction set controls the "thumb" image, which on this particular page is about 200px X 300px. The default image is very small as presented by the code.is very small.

    The expanded image loads properly - but I have been trying to raise it higher on the page. My old javascript had two parameters - one for horizontal and one for vertical positioning

    As I change one parameter it appears to either not do what I'd like it to do, or it affects the other image.

    1 - how to size the thumb?

    2 - how to size the expanded image?

    (Which CSS parameters do I use for each?)

    Thanks,

    Weblost
    Last edited by weblost; 01-19-2019 at 03:11 AM.

  2. #2
    Join Date
    Dec 2018
    Location
    Texas
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Try using this code to size the expanded image
    Code:
    {
      background: url(mountain.jpg);
      background-repeat: no-repeat;
      background-size: 300px 100px;
    }
    Last edited by keyboard; 01-28-2019 at 11:28 AM. Reason: Formatted with code tags

  3. #3
    Join Date
    Jan 2019
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Thanks

    David ,

    Thank you,

    I will try it and see if I can get it to work.

    (Excuse the delay - I write and am on a "deadline" for a project.)





    Quote Originally Posted by davidlee21 View Post
    Try using this code to size the expanded image
    Code:
    {
      background: url(mountain.jpg);
      background-repeat: no-repeat;
      background-size: 300px 100px;
    }

  4. #4
    Join Date
    Apr 2019
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Do the images display correctly on mobile too with this resize code?

  5. #5
    Join Date
    Jan 2019
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hello,
    As I read you want to know how you expand the image size.
    you have to try code to expand your image like
    Code:
    Code:
    {
      background: url(Your image name);
      background-repeat: no-repeat;
      background-size: 300px 100px;
    }
    Hope this will help you.
    Thanks
    Last edited by keyboard; 04-26-2019 at 09:18 AM.

Similar Threads

  1. Help or Replacement of Marquee Tag
    By Jim Weinberg in forum JavaScript
    Replies: 4
    Last Post: 09-24-2013, 07:50 PM
  2. Replies: 11
    Last Post: 05-23-2012, 11:39 PM
  3. Replies: 1
    Last Post: 05-25-2010, 06:47 PM
  4. Image Replacement
    By Johnny__Utah in forum JavaScript
    Replies: 0
    Last Post: 04-13-2008, 04:31 PM
  5. String Replacement
    By Titan85 in forum PHP
    Replies: 1
    Last Post: 04-13-2007, 08:23 PM

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
  •