Bust image out of top of div (whilst sitting on base of div)
Posted: 01 June 2007 07:46 AM   [ Ignore ]  
Lab Assistant
Avatar
RankRank
Total Posts:  134
Joined  03-23-2007

Hey. Can anyone help me do this?

How do I get an image to sit on the bottom of it’s containing div and then also bust out of the top of the div?

So if my image is 200px high, and I guess I can set my div to be 175px and my image will then just poke out the top of the div.

I also want the image to appear to overlap stuff like the top border of the div and borders of other elements in the div. (Like the chef at the bottom of the guardian’s homepage today: http://www.guardian.co.uk/) But I can’t seem to get the css to work.

My starting point::

CSS
img
.flippers
{
z
-index: 1;
float: right;
vertical-align: bottom;
}

#foot
{
height
: 175px;
}

HTML

<div id="foot">
<
img class="flippers" src="myimage.gif" />
</
div>

Thanks if you can help!

Profile
 
 
Posted: 01 June 2007 11:09 AM   [ Ignore ]   [ # 1 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  351
Joined  02-03-2005

it’s hard to say without seeing a more in-depth example, but you’ll probbly need to define a z-index for all of the elements you want the image to overlap (if your image’s z-index is 1, it isn’t going to overlap anything). is part of your image transparent? are the items that it is supposed to overlap fixed, or might they change? If they won’t change, you could just fake it and include the overlapped items as part of the image. If they will change, you can do it using a combination of transparency, z-index and positioning.

 Signature 

Artificial Memory

Profile
 
 
Posted: 05 June 2007 03:58 PM   [ Ignore ]   [ # 2 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  129
Joined  03-31-2004

Try setting the width and height properties of your image in the IMG tag.

Profile
 
 
Posted: 06 June 2007 05:25 PM   [ Ignore ]   [ # 3 ]  
Grad Student
Rank
Total Posts:  88
Joined  09-12-2006

hi pie,

not sure, but try setting position:relative on div#foot, then set position:absolute on your img and give the img a negative “top” value ...

just one thought

ted

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1743, on December 02, 2009 03:47 PM
Total Registered Members: 120205 Total Logged-in Users: 113
Total Topics: 126336 Total Anonymous Users: 56
Total Replies: 664407 Total Guests: 527
Total Posts: 790743    
Members ( View Memberlist )