I have a table that is supposed to contain images. When howering an image, I want a control buttons to appear at the top of the table cell.
<table id="pridat_fotky">
<tbody>
<tr>
<td class="empty">
<button>X</button>
</td>
</tr>
</tbody>
</table>
So, what I tried wa giving the table cell a position:relative
and position:absolute
for the button:
table#pridat_fotky td {
position: relative;
}
/**THE BUTTON**/
table td button {
position: absolute;
top: 0px; /*0 means as hight as possible within the cell???*/
left: 50%; /**MIDDLE ALIGMENT???*/
}
Unfortunatelly, with this setup, the button aligns itself to the top of the window. Here is a fiddle, Button is a little red square.