Jump to content

displaying image relatively over table


scarhand

Recommended Posts

im trying to get an image to display over the top-right side of a table

 

heres my code:

 

<img src="myphoto.gif" style="float: right; position: relative; top: 10px; right: 10px;">

<table width="100%" border="1">
<tr>
<td width="100%">

this is the table the image should be displaying inside of the top-right corner

</td>
</tr>
</table

 

the problem is, it seems that the float is causing it to still recognize the image as being beside it, so the image only goes into the table 10px and the table's width gets cut off where the image would normally start

 

any help would greatly be appreciated.

Link to comment
https://forums.phpfreaks.com/topic/81248-displaying-image-relatively-over-table/
Share on other sites

try this:

 

<table width="100%" border="1">
<tr>
<td width="100%">

this is the table the image should be displaying inside of the top-right corner
<img src="myphoto.gif" style="float:right; margin-top:-20px; clear:both">

</td>
</tr>
</table>

if you want the image to be above your table; you'll need to set the position to absolute, add a higher z-index then the rest of the elements/objects in your page. if your wanting it to float on top of your web pages content and float down the page as you scroll; you need to do a Google search for "Floating DIV" (this goes beyond plan css; it then becomes dhtml).

 

http://www.google.com/search?hl=en&q=Floating+DIV&btnG=Google+Search

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.