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 4 of 4

Thread: layer to image

  1. #1
    Regular Coder
    Join Date
    Jan 2007
    Posts
    154
    Thanks
    52
    Thanked 0 Times in 0 Posts

    layer to image

    Hi people! Quick question how can I change this code so that it displays the image as an image as opposed to an layer?

    PHP Code:
    <div style="position: relative;"><div id="product-image" style="background-image:url(/images/products/<?php echo $product_image?>);"></div><?php if ($range_on_sale == 'Y') { ?><div id="sale-now-on"><?php echo $range_sale_discount?>% off</div><?php ?></div>
    Thanks in advance!

  2. #2
    Supreme Master coder!
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    10,080
    Thanks
    10
    Thanked 1,158 Times in 1,149 Posts
    PHP Code:
    <div style="position: relative;">
    <div id="product-image">
    <img src="/images/products/<?php echo $product_image;?>" style="border:0;" alt="" title="" />
    </div>
    <?php
        
    if ($range_on_sale == 'Y') { 
        echo
    "<div id='sale-now-on'>$range_sale_discount;% off</div>";
        }
    ?>
    </div>

  3. Users who have thanked mlseim for this post:

    thoford75 (10-17-2009)

  4. #3
    Regular Coder
    Join Date
    Nov 2007
    Location
    Leeds, UK
    Posts
    514
    Thanks
    24
    Thanked 19 Times in 19 Posts
    Quote Originally Posted by mlseim View Post
    PHP Code:
    <div style="position: relative;">
    <div id="product-image">
    <img src="/images/products/<?php echo $product_image;?>" style="border:0;" alt="" title="" />
    </div>
    <?php
        
    if ($range_on_sale == 'Y') { 
        echo
    "<div id='sale-now-on'>$range_sale_discount;% off</div>";
        }
    ?>
    </div>
    this maybe using php but that is basic HTML man,

    <img for image & <div = a box you can play with
    Working towards a Internet where we don't have website just browser applications Kill the Hyper-link and say hello to 3D Games in the browser :)

  5. #4
    Supreme Master coder!
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    10,080
    Thanks
    10
    Thanked 1,158 Times in 1,149 Posts
    this maybe using php but that is basic HTML man,

    <img for image & <div = a box you can play with
    What does this mean?


 

Posting Permissions

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