Rock
12-28-2008, 08:44 PM
I've added a Javascript to my webpage that automatically generates a popup box (just a little message) when you first visit the website. I've tried fooling around with the coding but can't seem to get the thing centered both horizontally & vertically so that no matter whoever visits the website it's always perfectly centered. I consider myself... well... intermediate when it comes to CSS and XHTML, but I'm either having the biggest brain fart of my life or something's just flat out wrong :confused:. Here's the code in it's entierty:
<center>
<div id="showimage" style="width: 2px; position: absolute; top: 50%; height: 100px">
<table cellspacing="0" cellpadding="2" width="450" bgcolor="#000080" border="0">
<tbody>
<tr>
<td align="center" width="100%">
<table height="36" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td id="dragbar" style="cursor: pointer" width="100%" onMousedown="initializedrag(event)"><ilayer onSelectStart="return false" width="100%"></ilayer><layer width="100%" onMouseover="dragswitch=1;if (ns4) drag_dropns(showimage)" onMouseout="dragswitch=0"></layer><font face="Verdana" color="#ffffff"><strong><small><center>Attention All Visitors!</center></small></strong></font></td>
<td style="cursor: hand"><a onClick="hidebox();return false" href="#"><img height="14" alt="" width="16" border="0" src="close.gif" /></a></td>
</tr>
<tr>
<td style="padding-right: 4px; padding-left: 4px; padding-bottom: 4px; padding-top: 4px" width="100%" bgcolor="#ffffff" colspan="2"><font color="#000000"><center><img alt="" src="limewire.png" /><br />
- <strong>WARNING</strong> -<br />
This information has been removed from what it actually says on the website lol. Ignore me!</center></font></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</center>
I just copy pasted the entire HTML part of the popup box. If need be, I can post the Java part but it has nothing to do with the box's attributes (position, height, width, etc) so I don't see why I should post that part. And since I did just copy & paste, ignore the message text :p .
<center>
<div id="showimage" style="width: 2px; position: absolute; top: 50%; height: 100px">
<table cellspacing="0" cellpadding="2" width="450" bgcolor="#000080" border="0">
<tbody>
<tr>
<td align="center" width="100%">
<table height="36" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td id="dragbar" style="cursor: pointer" width="100%" onMousedown="initializedrag(event)"><ilayer onSelectStart="return false" width="100%"></ilayer><layer width="100%" onMouseover="dragswitch=1;if (ns4) drag_dropns(showimage)" onMouseout="dragswitch=0"></layer><font face="Verdana" color="#ffffff"><strong><small><center>Attention All Visitors!</center></small></strong></font></td>
<td style="cursor: hand"><a onClick="hidebox();return false" href="#"><img height="14" alt="" width="16" border="0" src="close.gif" /></a></td>
</tr>
<tr>
<td style="padding-right: 4px; padding-left: 4px; padding-bottom: 4px; padding-top: 4px" width="100%" bgcolor="#ffffff" colspan="2"><font color="#000000"><center><img alt="" src="limewire.png" /><br />
- <strong>WARNING</strong> -<br />
This information has been removed from what it actually says on the website lol. Ignore me!</center></font></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</center>
I just copy pasted the entire HTML part of the popup box. If need be, I can post the Java part but it has nothing to do with the box's attributes (position, height, width, etc) so I don't see why I should post that part. And since I did just copy & paste, ignore the message text :p .