Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

positioning of divs

Status
Not open for further replies.

brews

Technical User
Dec 12, 2007
194
US
Have been trying to place a div on top of another and seem to have run into a wall.

The page has a header with a pix under the header and then three columns under the pix. The pix has another div over layed float: right. Whenever I try to move the div to over lay the pix, it involves using position: relative; top: -150px;. Which leads to some more negative positioning of the other three columns. Also messes up the length of the page which places a big gap between the bottom of the three columns and the footer.

Here is what I have so far:
What needs to be done is to move the yellow square on top of the flag/man-holding-child allowing Location Shots to move up in line with the other two columns.

Thanks.
 
Why not put use your main image as a div background image and then place the yellow square in the top div using padding. That way you do not need to overlap divs .

Keith
 
If you have control over the source, put the coyote div inside the flag div like such:
Code:
<div id="flag">
  <img src="images/about_flag.gif" alt="flag" />
  <div id="coyote"></div><!--end coyote-->
</div><!--end flag-->

* this is along the lines of what audiopro mentioned above, btw, except I left the image in the page *

Then your CSS for positioning looks like:
Code:
#flag { position:relative; }
#coyote { position:absolute; right:0; top:0; }

Apply your other styles as required.

Greg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top