scarhand Posted December 11, 2007 Share Posted December 11, 2007 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 More sharing options...
phpQuestioner Posted December 11, 2007 Share Posted December 11, 2007 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> Link to comment https://forums.phpfreaks.com/topic/81248-displaying-image-relatively-over-table/#findComment-412308 Share on other sites More sharing options...
scarhand Posted December 11, 2007 Author Share Posted December 11, 2007 i cant have it inside the TD and i want it to overlay over multiple TD's as if its literally floating over the table Link to comment https://forums.phpfreaks.com/topic/81248-displaying-image-relatively-over-table/#findComment-412357 Share on other sites More sharing options...
phpQuestioner Posted December 11, 2007 Share Posted December 11, 2007 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 Link to comment https://forums.phpfreaks.com/topic/81248-displaying-image-relatively-over-table/#findComment-412363 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.