Redefining the keyword 'relative'

Discussion in 'HTML & Website Design' started by Twinbee, Jun 13, 2009.

  1. #1
    Is it possible to place text/pics etc. relative to a different position of the previous element, or an earlier element rather than the last thing placed in the code?

    Tricky to explain. So example code would be the following. I want to achieve two things. Firstly, I would like to define the 'relative' word so that "testing" appears relative to the first table (i.e. just underneath it). So somehow I need a 'marker' to remember the position of the first table.

    Secondly, I would like to define "relative" to be flexible so that it could be relative to the bottom left corner, or bottom right corner of a table. Of course, one can use the align keyword for this, but sometimes relative is necessary for pixel precision (say if you want an indent etc.).

    
    <div align=center>
    
    	<table border=4 width=500px>
    	<tr><td>box 1</td></tr>
    	</table>
    
    	<br><br><br><br>
    
    	<table border=4 width=500px>
    	<tr><td>box 2</td></tr>
    	</table>
    
    	<div style="position: relative; left: 0px; top:0px">
    	testing2
    	</div>
    
    </div>
    
    Code (markup):

     
    Twinbee, Jun 13, 2009 IP