Image over Another image

Discussion in 'HTML & Website Design' started by harshida_1909, Oct 15, 2009.

  1. #1
    Hello All,
    How do i insert two images in single table, means what i am saying is i have two image, now i placed one image when i placed second image it will display right side of first image but i want display second image over the first image.



    Thanks
    HArshida
     
    harshida_1909, Oct 15, 2009 IP
  2. MhW

    MhW Active Member

    Messages:
    370
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    85
    #2
    HTML:
    <div class="first-image"><img src="second-image.jpg" width="250" height="250" alt="" /></div>
    Code (markup):
    CSS:
    .first-image {background-image: url("first-image.jpg"); width: 250px; height: 250px;}
    Code (markup):
    ..is the easiest way I can think of doing it. Remember to change the width and height to suit your needs. I guess you could also use CSS positioning / Z-index but for beginners it would be easier to use the above method. Let us know if you need any more help. :)
     
    MhW, Oct 15, 2009 IP
  3. dafty

    dafty Member

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #3
    Go on the w3schools website and search "CSS Positioning" there is plenty that covers this subject.
     
    dafty, Oct 15, 2009 IP
  4. leebari

    leebari Peon

    Messages:
    50
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You can use position:absolute in CSS to place one image on top of another.
     
    leebari, Oct 16, 2009 IP
  5. SeoStuff

    SeoStuff Peon

    Messages:
    61
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I think you can use java script also for implementing this.But as long as it can be done with CSS, thats best.
     
    SeoStuff, Oct 16, 2009 IP