Tom Be
Tom Be

Reputation: 23

Absolute within a DIV

I am trying to position an image within another image, so i can change the position one image above another image.

This is the wrapper:

<!--Start Slider Wrapper-->
        <div class="slider_wrapper">
         <div id="main" class="container">            
              <div id="foto1" class="foto1"> <?php if (inkthemes_get_option('inkthemes_featureimg') != '') { ?>
                 <img src="<?php echo inkthemes_get_option('inkthemes_featureimg'); ?>"/>
            <?php } else { ?>
                 <img src="<?php echo get_template_directory_uri(); ?>/images/slideimg.jpg"/>
            <?php } ?>
        </div>
        <div id="groenid" class="groenclass"><img src="<?php echo get_template_directory_uri(); ?>/images/groen.jpg" />
        </div>          
        <div class="slider_shadow"></div>
    </div>
     </div>
     </div>
    <!--End Slider wrapper-->

This is the CSS:

    #main {
    padding: 10px;
    background: #f9fbfb;
    border: 1px solid #ccc;
    z-index:1;
    height:460px;
    width: 928px;
}
#foto1 img{
    position:absolute;
    width: 928px;
    height: 460px;
    z-index:1;
}
#groenid {
   width: 116px;
   height:113px;
   position:absolute;
   z-index:2;
   top:0px;
   left:0px;

I thought this was okay but the image positions at top:0px left:0px at the top left corner of the website, while i want it to position in the top left corner of the image..

Can somebody help me? It's for school and much appreciated

Upvotes: 0

Views: 64

Answers (1)

Vahid
Vahid

Reputation: 382

do you tested margin? or top:0px; left:116px; for example? maybe nested div blocks or float left right can help you here.

Upvotes: 1

Related Questions