CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 19th, 2004, 10:42 PM
jpluttme jpluttme is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 83 jpluttme User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 45 m 20 sec
Reputation Power: 8
CSS image positioning issue

I need to have numerous images overlap exactly on top of one another at the upper left corner of a frame cell.

When I use absolute positioning, the image is not where it is supposed to be in relation to the table cell.

Relative works, but I cannot seem to overlay the images, as adding images via relative layers just acts as if the images are not in layers at all (i.e. they take up the same space that they would in a normal flowing page)

Is there any way I can make the images be placed relative to the corner of the table cell?

I'm somewhat new to layers, so any help would be greatly appreciated.

Here is example code


<TABLE WIDTH=500 HEIGHT=500 BORDER=0>
<TR>
<TD width=300 height=100>

Need image1 to go in this cell, as well as image2, image3, and image4. All need to overlap perfectly in relation to the constraints of this table cell.

Here is the code I use in the cell for the first 2 layers which just flow one under the other- yet I need them to overlap.

<div id="Layer1" style="position:relative; width:518px; height:322px; z-index:1; visibility: visible;"><img src="images/Map2.gif" usemap="#Map" border=0></div>
<div id="Layer2" style="position:relative; width:518px; height:322px; z-index:2; visibility: hidden;"><img src="images/iloverlay.gif" usemap="#Map" border=0></div>

</TD>
<TD></TD>
</TR>
<TR>
<TD></TD>
<TD></TD>
</TR>
<table>

Reply With Quote
  #2  
Old March 20th, 2004, 01:48 AM
kk5st's Avatar
kk5st kk5st is offline
Thanks Johnny Hart (BC) R.I.P.
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: May 2003
Location: Dallas
Posts: 4,555 kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 1 Month 2 Days 7 h 49 m 53 sec
Reputation Power: 630
Relative positioned elements are in the flow, whille absolute positioned elements are not. For some very good explanations, read the articles at /*PIE*/. A minimum test case of what you're describing;
Code:
<table>
  <tr>
    <td>
      <img src="somepic1.jpg" style="position: absolute;"
      height="100px" width="300px"  />
      <img src="somepic2.jpg" style="position: absolute"
      height="100px" width="300px" />
    </td>
  </tr>
</table>
You can control which pic is on top/visible by manipulating the z-index or display: none/block. If you use visibility: hidden/visible, you will still have z-index concerns.

cheers,

gary
__________________
There are those who manage to build a web site without knowing what they're doing; thereby proving to themselves they do, indeed, know what they're doing.

Ask a better question, get a better answer.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > CSS image positioning issue


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway