Jessy Jordan
Jessy Jordan

Reputation: 79

positioning Div inside another Div with centered background image?

I have a Div which has an image of world map centered inside it. and there is another div within this Div.

what I am trying to do is to put some texts inside the second div and place it on the top of the world map image. I can do this without any problem but when i resize the browser, it seems like the second div moves from its original place!

I have demonstrated the issue in the images bellow:

enter image description here

ON BROWSER RESIZE I GET THIS:

enter image description here

And here is my CSS:

#body{
    top:0px;


}


#wrapper{
    position:absolute;
    width:100%;
    top:0px;
    left:0px;
    right:0px;
    bottom:0px;
    min-width:100%;

}

#flagHolder a:link, a:active, a:visited{
    font-family:Verdana, Geneva, sans-serif;
    color:#333;
    text-decoration:none;
      margin-left: auto ;
  margin-right: auto ;
}

#header{
    background-image:url(img/bg-header_footer.jpg);
    width:100%;
    height:250px;


}
#footer{
    background-image:url(img/footer.png);
    width:100%;
    height:250px;


}

#content{


}

#flagHolder{

    width:80%;
    border-radius:15px;
    border:solid 2px #ecf0f1;


}

#mapHolder{
    background-image:url(img/map.png);
    background-repeat:no-repeat;
    background-position:center;
    width:100%;
    height:419px;




}

#apDiv1 {
    position:relative;
    margin-right:30%;
    width:115px;
    height:100px;
    z-index:1;
    font-size:10px;
    font-family:Verdana, Geneva, sans-serif;
}

How can make the text Div stay relative according to Map?

EDIT:

Here is the HTML:

    <div id="wrapper" align="center">

    <div id="header"></div>

    <div id="content">



    <div id="mapHolder"  oncontextmenu='alert("Copyrighted Content");return false;'>

      <div id="apDiv1"  oncontextmenu='alert("Copyrighted Content");return false;'>
      LA, USA
      <div>



      </div>

    </div>
</div>

Upvotes: 1

Views: 408

Answers (1)

shyam selvan
shyam selvan

Reputation: 72

use position as absolute instead of relative to ur second div and its elements......Hope this works

Upvotes: 2

Related Questions