XpertWorlock Posted December 8, 2008 Share Posted December 8, 2008 I have one image and I have one semi transparent image. Both are in a table, how do I have the semi transparent image completely overlap the other image, both are the same size. echo '<DIV STYLE="{z-index:1;}; position:relative"> <img src="./images/fullimage.png" height="100px" width="100px"></div>'; echo '<DIV STYLE="{z-index:2;}; position:absolute"> <img src="./images/transparentimage.png' height="100px" width="100px"></div>'; As you see, I'm heading in the right direction with div's, but I am confused. Remember these are both in a table cell any help is appreciated Quote Link to comment Share on other sites More sharing options...
TheFilmGod Posted December 8, 2008 Share Posted December 8, 2008 Please parse the php and provide the final html. A link to the webpage would also help! Quote Link to comment Share on other sites More sharing options...
XpertWorlock Posted December 8, 2008 Author Share Posted December 8, 2008 Trying to get it so second div is positioned within the cell no matter where the table is located on page. ex. If table is at bottom of screen, the second div shouldn't care and position itself within the table, not the screen. Hope this helps <?php /*Trying to get it so second div is positioned within the cell no matter where the table is located on page*/ echo "<br><br>"; echo "<table border='1'><tr><td>"; echo " <DIV STYLE=\"z-index:1; position:relative;\"> <img src='http://www.mikesforums.com/game/images/terrain/grass.png'> </div>"; echo " <DIV STYLE=\"z-index:2; position:absolute; top:50; left:50;\"> <img src='http://www.mikesforums.com/game/images/units/soldier_east.png'> </div>"; echo "</td></tr></table>"; ?> Quote Link to comment Share on other sites More sharing options...
dropfaith Posted December 8, 2008 Share Posted December 8, 2008 they would both be in the table anyways if the absolute pos wasnt used im not clear what your trying to do putting things in a table is as easy as just adding code to the table no posistion needed or use absolute on both and put them in the same spot Quote Link to comment Share on other sites More sharing options...
haku Posted December 8, 2008 Share Posted December 8, 2008 Or set the containing cell's position to relative, and absolutely position the second image within that cell. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.