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
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,549
    Thanks
    8
    Thanked 1,095 Times in 1,086 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>

  • Users who have thanked mlseim for this post:

    thoford75 (10-17-2009)

  • #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 :)

  • #4
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,549
    Thanks
    8
    Thanked 1,095 Times in 1,086 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
    •