css - Prevent div block from moving when window resized -
i have div block overlays on top of parent div, when window resized, child div moves around crazy. how can prevent happening. here link site: http://raider.grcc.edu/~ryanduffing/recordstore/
here relevant css code, , html code:
<div id="overlaydescription" class="my_corner"> <span id="overheader"><span id="chevron">»</span>the corner</span> <span id="overheader2">record shop</span> <p id="overcontent"></p> </div> <div id="picturebox"> <img src="img/storefront.jpg" /> </div> #picturebox{ margin-top: 10px; margin-left:auto; margin-right:auto; width: 940px; height: 420px; position: relative; z-index: 1; } #overlaydescription{ font-size: 11px; position:absolute; top: 290px; right: 489px; height: 265px; border: 1px solid #ffffff; width: 240px; color: #ffffff; background-color:rgba(0,0,0,.9); z-index: 2; border-radius: 100px 0 0 0; } #overlaydescription span#overheader{ font-family: arial narrow; position:relative; font-size: 25px; left: 80px; top: 10px; } #overlaydescription span#chevron{ position:relative; left: -5px; font-family: arial narrow; font-size: 35px; color: yellow; } #overlaydescription span#overheader2{ font-family: arial narrow; color: yellow; position:relative; top: 10px; left: 80px; font-size: 25px; } #overlaydescription p#overcontent{ position:absolute; padding-left: 25px; }
you have make child's absolute position relative parent.
#content { position: relative; } #overlaydescription { top: 140px; right: 327px; /* rest of styles element */ }
Comments
Post a Comment