I have a mix of a single column table with a few rows with one primary row that contains the content. I am using quite a few divs to stack elements (mainly images) the way I need. I have all of the divs aligned relative to their position in the table. My problem is that the page gets very long, very quick. It extends down way past the content. It almost seems that the page is twice as long as it needs to be, like there is a phantom of each element that is making the page long.
This is my first time to attempt a design like this, so I know I'm either doing something inefficiently, or I've simply neglected to do something basic.
Here's my code:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<SCRIPT language=Javascript>
var nav;
home_over=new Image(69,32);
home_over.src="homec.png";
home_out=new Image(69,32);
home_out.src="home.png";
about_us_over=new Image(99,32);
about_us_over.src="about_usc.png";
about_us_out=new Image(99,32);
about_us_out.src="about_us.png";
worship_over=new Image(88,36);
worship_over.src="worshipc.png";
worship_out=new Image(88,36);
worship_out.src="worship.png";
ministries_over=new Image(105,32);
ministries_over.src="ministriesc.png";
ministries_out=new Image(105,32);
ministries_out.src="ministries.png";
recovery_over=new Image(96,36);
recovery_over.src="recoveryc.png";
recovery_out=new Image(96,36);
recovery_out.src="recovery.png";
support_over=new Image(89,36);
support_over.src="supportc.png";
support_out=new Image(89,36);
support_out.src="support.png";
</SCRIPT>
<style type="text/css">
#dropmenudiv{
position:absolute;
background-color: #888888;
border:1px solid black;
border-bottom-width: 0;
font:normal 12px Verdana;
line-height:18px;
z-index:1;
}
#dropmenudiv a{
width: 100%;
display: block;
text-indent: 3px;
border-bottom: 1px solid black;
padding: 1px 0;
text-decoration: none;
font-weight: bold;
color:#000000
}
#dropmenudiv a:hover{
background-color: #C8C8C8;
color:#FFFFFF
}
#dropmenudiv2{
position:absolute;
background-color: #888888;
border:1px solid black;
border-bottom-width: 0;
font:normal 12px Verdana;
line-height:18px;
z-index:10;
}
#dropmenudiv2 a{
width: 100%;
display: block;
text-indent: 3px;
border-bottom: 1px solid black;
padding: 1px 0;
text-decoration: none;
font-weight: bold;
color:#000000
}
#dropmenudiv2 a:hover{
background-color: #C8C8C8;
color:#FFFFFF
}
#calendar{;
padding-top: 15px;
padding-left: 0px;
font:bold 12px Verdana;
line-height:18px;
z-index:2;
}
#calendar a{
padding-left: 15px;
display: block;
text-indent: 3px;
text-decoration: none;
font-weight: bold;
color:#000000
}
#calendar a:hover{
color:#FFFFFF
}
. H3{
font-size: large;
font:bold Verdana;
word-spacing: 1px;
line-height:1px;
font-weight: bold;
color:#000000
}
</style>
<script type="text/javascript" src="menu_script.js">
</script>
<script type="text/javascript" src="menu_script2.js">
</script>
<script>
//Necessary for the Alpha Transparency of .png bg images (is not my own script)
var bgsleight = function() {
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
if (oldonload) {
oldonload();
}
func();
}
}
}
function fnLoadPngs() {
var rslt = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '');
var itsAllGood = (rslt != null && Number(rslt[1]) >= 5.5);
for (var i = document.all.length - 1, obj = null; (obj = document.all); i--) {
if (itsAllGood && obj.currentStyle.backgroundImage.match(/\.png/i) != null) {
fnFixPng(obj);
obj.attachEvent("onpropertychange", fnPropertyChanged);
}
}
}
function fnPropertyChanged() {
if (window.event.propertyName == "style.backgroundImage") {
var el = window.event.srcElement;
if (!el.currentStyle.backgroundImage.match(/x\.gif/i)) {
var bg = el.currentStyle.backgroundImage;
var src = bg.substring(5,bg.length-2);
el.filters.item(0).src = src;
el.style.backgroundImage = "url(x.gif)";
}
}
}
function fnFixPng(obj) {
var bg = obj.currentStyle.backgroundImage;
var src = bg.substring(5,bg.length-2);
obj.style.filter = "progid
XImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='scale')";
obj.style.backgroundImage = "url(x.gif)";
}
return {
init: function() {
if (navigator.platform == "Win32" && navigator.appName == "Microsoft Internet Explorer" && window.attachEvent) {
addLoadEvent(fnLoadPngs);
}
}
}
}();
bgsleight.init();
</script>
</head>
<SCRIPT>
//allows me to maintain alpha transparency for .png images while doing image rollovers. (is my own)
function hover(nav)
{
{
document.images[nav].style.filter="progid
XImageTransform.Microsoft.AlphaImageLoader(src='"+nav+"c.png', sizingMethod='scale')";
}
}
function out(nav)
{
{
document.images[nav].style.filter="progid
XImageTransform.Microsoft.AlphaImageLoader(src='"+nav+".png', sizingMethod='scale')";
}
}
</SCRIPT>
<body background="bg.gif" style="background-repeat:repeat">
<center>
<table width="800" height="100%" hspace="0" vspace="0" border="0" cellpadding="0" cellspacing="0" style=" vertical-align:top"><tr><td colspan="10" background="main_top.png" style="background-repeat:no-repeat; background-position:center; "> </td></tr><tr align="left">
<td background="main.png" align="left" style="background-repeat:repeat-y;background-position:center; vertical-align:middle;">
<div id="body" style="background-color:#FFFFFF;width:550px;display:block;position:relative;top:250px;left:215px;z-index:1;">
<h1><center>Test</center></h1><br />
</div>
<div style="width:316px;height:115px;display:inline-block;filter
rogid
XImageTransform.Microsoft.AlphaImageLoader(src='logo.png');position:relative;z-index:20">
<img style="filter
rogid
XImageTransform.Microsoft.Alpha(opacity=0);" src="logo.png" width="316" height="115" border="0" align="left" alt="" />
</div>
<div style="width:634px;height:45px;display:inline-block;filter
rogid
XImageTransform.Microsoft.AlphaImageLoader(src='menu_bar.png');position:relative;top:-22px;left:55px;z-index:10">
<img style="filter
rogid
XImageTransform.Microsoft.Alpha(opacity=0);" src="menu_bar.png" width="634" height="45" border="0" align="left" alt="" />
</div>
<!-- Add Changes for Opera Via PHP switch -->
<div style="width:634px;height:45px;display:inline-block;position:relative;top:-59px;left:94px;z-index:11">
<a href=# onMouseover="hover('home');hidemenu()" onMouseout="out('home');">
<img style="filter
rogid
XImageTransform.Microsoft.AlphaImageLoader(src='home.png',
sizingMethod='scale');" src="transparent.gif" width="69" height="32" border="0" align="left" alt="Home" id='home' /></a>
<a href='#' onMouseover="dropdownmenu(this, event, menu1, '150px', 0, -19, 'about_us');over('about_us')" onMouseout="delayhidemenu('about_us');">
<img style="filter
rogid
XImageTransform.Microsoft.AlphaImageLoader(enabled=true, src='about_us.png',
sizingMethod='scale');" src="transparent.gif" width="99" height="32" border="0" align="left" id='about_us' alt="About Calvary Baptist Church" />
</a>
<a href='#' onMouseover="dropdownmenu(this, event, menu2, '170px', 0, -23, 'worship')" onMouseout="delayhidemenu('worship')">
<img style="filter
rogid
XImageTransform.Microsoft.AlphaImageLoader(src='worship.png',
sizingMethod='scale');" src="transparent.gif" width="88" height="36" border="0" id='worship' align="left" alt="Worship Options" />
</a>
<a href='#' onMouseover="dropdownmenu(this, event, menu3, '160px', 0, -19, 'ministries')" onMouseout="delayhidemenu('ministries')">
<img style="filter
rogid
XImageTransform.Microsoft.AlphaImageLoader(src='ministries.png',
sizingMethod='scale');" src="transparent.gif" width="105" height="32" border="0" id='ministries' align="left" alt="Ministry Options" />
</a>
<a href='#' onMouseover="dropdownmenu(this, event, menu5, '150px', 0, -23, 'recovery')" onMouseout="delayhidemenu('recovery')">
<img style="filter
rogid
XImageTransform.Microsoft.AlphaImageLoader(src='recovery.png',
sizingMethod='scale');" src="transparent.gif" width="96" height="36" border="0" id='recovery' align="left" alt="Calvary's Recovery Program for those in need" />
</a>
<a href='#' onMouseover="dropdownmenu(this, event, menu6, '150px', -25, -23, 'support')" onMouseout="delayhidemenu('support')">
<img style="filter
rogid
XImageTransform.Microsoft.AlphaImageLoader(src='support.png',
sizingMethod='scale');" src="transparent.gif" width="89" height="36" border="0" id='support' align="left" alt="Calvary's Support Program" /></a>
</div>
<div style="height:400px;z-index:1;vertical-align:middle">
<div style="width:222px;height:429px;display:block;position:relative;top:-30px;left:-50px;z-index:1;filter
rogid
XImageTransform.Microsoft.AlphaImageLoader(src='events_bg.png')">
<img border="0" id="events_bg" src="transparent.gif" width="222" height"429" />
</div>
<div style="width:230px;height:65px;display:block;position:relative;top:-480px;left:-40px;z-index:1;filter
rogid
XImageTransform.Microsoft.AlphaImageLoader(src='upcoming_events.png')">
<img border="0" id="events_title" src="transparent.gif" width="230" height"65" />
</div>
<div style="width:123px;height:137px;display:block;position:relative;top:-465px;left:-5px;z-index:1;filter
rogid
XImageTransform.Microsoft.AlphaImageLoader(src='guest_image.png')">
<img border="0" id="guest_image" src="transparent.gif" width="123" height"137" />
</div>
<div style="width:214px;height:45px;display:block;position:relative;top:-635px;left:-47px;z-index:1;filter
rogid
XImageTransform.Microsoft.AlphaImageLoader(src='guest_name.png')">
<img border="0" id="guest_name" src="transparent.gif" width="214" height"45" />
</div>
<div style="width:230px;height:65px;display:block;position:relative;top:-515px;left:-70px;z-index:1;filter
rogid
XImageTransform.Microsoft.AlphaImageLoader(src='events_calendar.png')">
<img border="0" id="events_calendar_title" src="transparent.gif" width="230" height"65" style="float:left" />
</div>
<div align="left" id="calendar" style="width:224px;height:187px;display:block;position:relative;top:-515px;left:-15px;z-index:1;background-image:url(calendar_bg.png);background-repeat:no-repeat;">
<center><div style="font-size:medium;">October, 2006</div><br /></center>
<a href=#>This is a link test</a><br />
</div>
</div>
</td>
</tr><tr><td background="main_bottom.png" align="center" style="background-repeat:no-repeat; background-position:center;vertical-align:bottom;"><div style="height:60px;width:840px">Copyright Info</div></td></tr></table>
</center>
</body>
</html>
I appreciate any help, CONSTRUCTIVE criticism, and suggestions anyone can offer.
This is my first time to attempt a design like this, so I know I'm either doing something inefficiently, or I've simply neglected to do something basic.
Here's my code:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<SCRIPT language=Javascript>
var nav;
home_over=new Image(69,32);
home_over.src="homec.png";
home_out=new Image(69,32);
home_out.src="home.png";
about_us_over=new Image(99,32);
about_us_over.src="about_usc.png";
about_us_out=new Image(99,32);
about_us_out.src="about_us.png";
worship_over=new Image(88,36);
worship_over.src="worshipc.png";
worship_out=new Image(88,36);
worship_out.src="worship.png";
ministries_over=new Image(105,32);
ministries_over.src="ministriesc.png";
ministries_out=new Image(105,32);
ministries_out.src="ministries.png";
recovery_over=new Image(96,36);
recovery_over.src="recoveryc.png";
recovery_out=new Image(96,36);
recovery_out.src="recovery.png";
support_over=new Image(89,36);
support_over.src="supportc.png";
support_out=new Image(89,36);
support_out.src="support.png";
</SCRIPT>
<style type="text/css">
#dropmenudiv{
position:absolute;
background-color: #888888;
border:1px solid black;
border-bottom-width: 0;
font:normal 12px Verdana;
line-height:18px;
z-index:1;
}
#dropmenudiv a{
width: 100%;
display: block;
text-indent: 3px;
border-bottom: 1px solid black;
padding: 1px 0;
text-decoration: none;
font-weight: bold;
color:#000000
}
#dropmenudiv a:hover{
background-color: #C8C8C8;
color:#FFFFFF
}
#dropmenudiv2{
position:absolute;
background-color: #888888;
border:1px solid black;
border-bottom-width: 0;
font:normal 12px Verdana;
line-height:18px;
z-index:10;
}
#dropmenudiv2 a{
width: 100%;
display: block;
text-indent: 3px;
border-bottom: 1px solid black;
padding: 1px 0;
text-decoration: none;
font-weight: bold;
color:#000000
}
#dropmenudiv2 a:hover{
background-color: #C8C8C8;
color:#FFFFFF
}
#calendar{;
padding-top: 15px;
padding-left: 0px;
font:bold 12px Verdana;
line-height:18px;
z-index:2;
}
#calendar a{
padding-left: 15px;
display: block;
text-indent: 3px;
text-decoration: none;
font-weight: bold;
color:#000000
}
#calendar a:hover{
color:#FFFFFF
}
. H3{
font-size: large;
font:bold Verdana;
word-spacing: 1px;
line-height:1px;
font-weight: bold;
color:#000000
}
</style>
<script type="text/javascript" src="menu_script.js">
</script>
<script type="text/javascript" src="menu_script2.js">
</script>
<script>
//Necessary for the Alpha Transparency of .png bg images (is not my own script)
var bgsleight = function() {
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
if (oldonload) {
oldonload();
}
func();
}
}
}
function fnLoadPngs() {
var rslt = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '');
var itsAllGood = (rslt != null && Number(rslt[1]) >= 5.5);
for (var i = document.all.length - 1, obj = null; (obj = document.all); i--) {
if (itsAllGood && obj.currentStyle.backgroundImage.match(/\.png/i) != null) {
fnFixPng(obj);
obj.attachEvent("onpropertychange", fnPropertyChanged);
}
}
}
function fnPropertyChanged() {
if (window.event.propertyName == "style.backgroundImage") {
var el = window.event.srcElement;
if (!el.currentStyle.backgroundImage.match(/x\.gif/i)) {
var bg = el.currentStyle.backgroundImage;
var src = bg.substring(5,bg.length-2);
el.filters.item(0).src = src;
el.style.backgroundImage = "url(x.gif)";
}
}
}
function fnFixPng(obj) {
var bg = obj.currentStyle.backgroundImage;
var src = bg.substring(5,bg.length-2);
obj.style.filter = "progid
obj.style.backgroundImage = "url(x.gif)";
}
return {
init: function() {
if (navigator.platform == "Win32" && navigator.appName == "Microsoft Internet Explorer" && window.attachEvent) {
addLoadEvent(fnLoadPngs);
}
}
}
}();
bgsleight.init();
</script>
</head>
<SCRIPT>
//allows me to maintain alpha transparency for .png images while doing image rollovers. (is my own)
function hover(nav)
{
{
document.images[nav].style.filter="progid
}
}
function out(nav)
{
{
document.images[nav].style.filter="progid
}
}
</SCRIPT>
<body background="bg.gif" style="background-repeat:repeat">
<center>
<table width="800" height="100%" hspace="0" vspace="0" border="0" cellpadding="0" cellspacing="0" style=" vertical-align:top"><tr><td colspan="10" background="main_top.png" style="background-repeat:no-repeat; background-position:center; "> </td></tr><tr align="left">
<td background="main.png" align="left" style="background-repeat:repeat-y;background-position:center; vertical-align:middle;">
<div id="body" style="background-color:#FFFFFF;width:550px;display:block;position:relative;top:250px;left:215px;z-index:1;">
<h1><center>Test</center></h1><br />
</div>
<div style="width:316px;height:115px;display:inline-block;filter
<img style="filter
</div>
<div style="width:634px;height:45px;display:inline-block;filter
<img style="filter
</div>
<!-- Add Changes for Opera Via PHP switch -->
<div style="width:634px;height:45px;display:inline-block;position:relative;top:-59px;left:94px;z-index:11">
<a href=# onMouseover="hover('home');hidemenu()" onMouseout="out('home');">
<img style="filter
sizingMethod='scale');" src="transparent.gif" width="69" height="32" border="0" align="left" alt="Home" id='home' /></a>
<a href='#' onMouseover="dropdownmenu(this, event, menu1, '150px', 0, -19, 'about_us');over('about_us')" onMouseout="delayhidemenu('about_us');">
<img style="filter
sizingMethod='scale');" src="transparent.gif" width="99" height="32" border="0" align="left" id='about_us' alt="About Calvary Baptist Church" />
</a>
<a href='#' onMouseover="dropdownmenu(this, event, menu2, '170px', 0, -23, 'worship')" onMouseout="delayhidemenu('worship')">
<img style="filter
sizingMethod='scale');" src="transparent.gif" width="88" height="36" border="0" id='worship' align="left" alt="Worship Options" />
</a>
<a href='#' onMouseover="dropdownmenu(this, event, menu3, '160px', 0, -19, 'ministries')" onMouseout="delayhidemenu('ministries')">
<img style="filter
sizingMethod='scale');" src="transparent.gif" width="105" height="32" border="0" id='ministries' align="left" alt="Ministry Options" />
</a>
<a href='#' onMouseover="dropdownmenu(this, event, menu5, '150px', 0, -23, 'recovery')" onMouseout="delayhidemenu('recovery')">
<img style="filter
sizingMethod='scale');" src="transparent.gif" width="96" height="36" border="0" id='recovery' align="left" alt="Calvary's Recovery Program for those in need" />
</a>
<a href='#' onMouseover="dropdownmenu(this, event, menu6, '150px', -25, -23, 'support')" onMouseout="delayhidemenu('support')">
<img style="filter
sizingMethod='scale');" src="transparent.gif" width="89" height="36" border="0" id='support' align="left" alt="Calvary's Support Program" /></a>
</div>
<div style="height:400px;z-index:1;vertical-align:middle">
<div style="width:222px;height:429px;display:block;position:relative;top:-30px;left:-50px;z-index:1;filter
<img border="0" id="events_bg" src="transparent.gif" width="222" height"429" />
</div>
<div style="width:230px;height:65px;display:block;position:relative;top:-480px;left:-40px;z-index:1;filter
<img border="0" id="events_title" src="transparent.gif" width="230" height"65" />
</div>
<div style="width:123px;height:137px;display:block;position:relative;top:-465px;left:-5px;z-index:1;filter
<img border="0" id="guest_image" src="transparent.gif" width="123" height"137" />
</div>
<div style="width:214px;height:45px;display:block;position:relative;top:-635px;left:-47px;z-index:1;filter
<img border="0" id="guest_name" src="transparent.gif" width="214" height"45" />
</div>
<div style="width:230px;height:65px;display:block;position:relative;top:-515px;left:-70px;z-index:1;filter
<img border="0" id="events_calendar_title" src="transparent.gif" width="230" height"65" style="float:left" />
</div>
<div align="left" id="calendar" style="width:224px;height:187px;display:block;position:relative;top:-515px;left:-15px;z-index:1;background-image:url(calendar_bg.png);background-repeat:no-repeat;">
<center><div style="font-size:medium;">October, 2006</div><br /></center>
<a href=#>This is a link test</a><br />
</div>
</div>
</td>
</tr><tr><td background="main_bottom.png" align="center" style="background-repeat:no-repeat; background-position:center;vertical-align:bottom;"><div style="height:60px;width:840px">Copyright Info</div></td></tr></table>
</center>
</body>
</html>
I appreciate any help, CONSTRUCTIVE criticism, and suggestions anyone can offer.