Forum Moderators: open
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<META HTTP-EQUIV="content-language" CONTENT="en">
<TITLE>TITLE</TITLE>
<LINK REL="stylesheet" TYPE="text/css" HREF="css/links.css">
<META NAME="robots" CONTENT="index, follow, noarchive, noodp, noydir">
</HEAD>
<BODY>
<TABLE STYLE="width:100%;height:100%;">
<TR>
<TD ALIGN="center" VALIGN="middle">
<BR>
<!--#include virtual="ssi/menu-p1.html" -->
<P>
<TABLE STYLE="height:500;" BGCOLOR="#90afef" BACKGROUND="pic/bgimage.jpg" CELLPADDING="30">
<TR>
<TD ALIGN="center" VALIGN="top">
<BR>
<P>
PAGE TEXT
</TD>
</TR>
<TR>
<TD ALIGN="center" VALIGN="bottom">
<IMG SRC="pic/spacer.gif" WIDTH="160" HEIGHT="1" ALT="-"> <IMG SRC="pic/spacer.gif" WIDTH="160" HEIGHT="1" ALT="-"> <IMG SRC="pic/spacer.gif" WIDTH="160" HEIGHT="1" ALT="-"> <IMG SRC="pic/spacer.gif" WIDTH="160" HEIGHT="1" ALT="-"> <IMG SRC="pic/spacer.gif" WIDTH="160" HEIGHT="1" ALT="-">
</TD>
</TR>
</TABLE>
<P>
<!--#include virtual="ssi/menu-p1.html" -->
<P>
</TD>
</TR>
</TABLE>
</BODY>
</HTML> Keen eyes will quickly detect the "illegal" use of BACKGROUND in the context of TABLE
<TD ALIGN="center" VALIGN="top">
<BR>
<P>
PAGE TEXT
</TD>
</TR>
I would code your page like this...
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>untitled document</title>
<style>
html,body {
display:table;
width:100%;
height:100%;
margin:0;
}
body {
display:table-cell;
padding:15px;
vertical-align:middle;
background-color:#f0f0f0;
}
.fluid-content {
padding:30px;
background-color:#ef90af;
box-shadow:inset 0 0 20px #666;
}
#centered-content {
max-width:886px;
margin:15px auto;
background-color:#90afef;
}
#top-content {
min-height:190px;
padding:30px;
box-shadow:inset 0 0 20px #666;
}
#bottom-content {
min-height:190px;
padding:30px;
box-shadow:inset 0 0 20px #666;
}
</style>
</head>
<body>
<div class="fluid-content">
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec
ultricies sollicitudin nisi, ut molestie felis adipiscing sit
amet. Sed auctor vehicula commodo. Nam a nibh neque, vitae
faucibus felis. Vivamus at metus eget eros consequat fringilla.
Quisque magna magna, laoreet eu tempus sit amet, fringilla at
tellus. Praesent felis tortor, scelerisque vitae fringilla
non, porttitor et lacus. Ut ut sapien nec quam tincidunt
consectetur in nec lacus.
</p>
</div><!-- end .fluid-content -->
<div id="centered-content">
<div id="top-content">
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec
ultricies sollicitudin nisi, ut molestie felis adipiscing sit
amet. Sed auctor vehicula commodo. Nam a nibh neque, vitae
faucibus felis. Vivamus at metus eget eros consequat fringilla.
Quisque magna magna, laoreet eu tempus sit amet, fringilla at
tellus. Praesent felis tortor, scelerisque vitae fringilla
non, porttitor et lacus. Ut ut sapien nec quam tincidunt
consectetur in nec lacus.
</p>
</div><!-- end #top-content -->
<div id="bottom-content">
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec
ultricies sollicitudin nisi, ut molestie felis adipiscing sit
amet. Sed auctor vehicula commodo. Nam a nibh neque, vitae
faucibus felis. Vivamus at metus eget eros consequat fringilla.
Quisque magna magna, laoreet eu tempus sit amet, fringilla at
tellus. Praesent felis tortor, scelerisque vitae fringilla
non, porttitor et lacus. Ut ut sapien nec quam tincidunt
consectetur in nec lacus.
</p>
</div><!-- end #bottom-content -->
</div><!-- end #centered-content -->
<div class="fluid-content">
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec
ultricies sollicitudin nisi, ut molestie felis adipiscing sit
amet. Sed auctor vehicula commodo. Nam a nibh neque, vitae
faucibus felis. Vivamus at metus eget eros consequat fringilla.
Quisque magna magna, laoreet eu tempus sit amet, fringilla at
tellus. Praesent felis tortor, scelerisque vitae fringilla
non, porttitor et lacus. Ut ut sapien nec quam tincidunt
consectetur in nec lacus.
</p>
</div><!-- end .fluid-content -->
</body>
</html>
I forgot to mention that the only reason that "display:table"
and "display:table-cell" were used in the above code was
that the blue content box was required to be vertically and
horizontally centered on the page if there was no content
above or below it.
Other than that situation there is no need for it whatsoever. ;)
What's illegal about it?
I don't see what there is in this visual layout that requires tables at all
centered-content {
max-width:886px;
min-width:886px;
margin:15px auto;
background-color:#90afef;
} Well, using BACKGROUND in a table was never part of the standard
<TABLE STYLE="height:500;" BGCOLOR="#90afef" BACKGROUND="pic/bgimage.jpg" CELLPADDING="30"> <TABLE STYLE="height:500;bgcolor:#90afef;background:url(pic/bgimage.jpg)" CELLPADDING="30">. <TABLE STYLE="height:500;" BGCOLOR="#90afef" BACKGROUND="pic/bgimage.jpg" CELLPADDING="30">
...
<TABLE STYLE="height:500;bgcolor:#90afef;background:url(pic/bgimage.jpg)" CELLPADDING="30">
table.thisclass {height: 500px; background: #90afef no-repeat center url("pic/bgimage.jpg");}
table.thisclass td {padding: 30px;}
<TABLE STYLE="height:500;background-color:#90afef;background:url(pic/bgimage.jpg)" CELLPADDING="30"> <TABLE STYLE="height:500;background-color:#90afef;background-image:url(pic/bgimage.jpg)" CELLPADDING="30"> body {
background-color: #1f1f1f;
color: #000000;
}
.container {
height: 600px;
width: 900px;
position: absolute;
margin: -300px 0 0 -450px;
left: 50%;
top: 50%;
}
.imagebox {
height: 500px;
width: 900px;
background-color: 90afef; background-image: url(pic/bgimage.jp);
position: absolute;
margin: -250px 0 0 -450px;
left: 50%;
top: 50%;
}
.textbox {
height: 440px;
width: 840px;
position: absolute;
margin: -220px 0 0 -420px;
left: 50%;
top: 50%;
} <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<META HTTP-EQUIV="content-language" CONTENT="en">
<TITLE>Layout test: background image for a defined area of the screen</TITLE>
<META NAME="description" CONTENT="">
<META NAME="keywords" CONTENT="" >
<LINK REL="stylesheet" TYPE="text/css" HREF="css/links.css">
<META NAME="robots" CONTENT="noindex, follow, noarchive, noodp, noydir">
</HEAD>
<BODY>
<DIV CLASS="container">
<DIV ALIGN="center">
<!--#include virtual="ssi/menu-p1.html" -->
<P>
</DIV>
<DIV CLASS="imagebox">
<DIV CLASS="textbox">
<DIV ALIGN="center">
<H1>Title of the Page</H1>
Some kind of descriptive text (maybe a slogan)
<BR>
Supplementary information
<P>
The quick brown fox jumps over a lazy dog
<BR>
The five boxing wizards jump quickly. Amazingly few discotheques provide jukeboxes.
<P>
The job requires extra pluck and zeal from every young wage earner. Help?
<BR>
Pack my box with five dozen liquor jugs. Jackdaws love my big sphinx of quartz.
<P>
<I>Special: A quart jar of oil mixed with zinc oxide makes a very bright paint.
<BR>
A mad boxer shot a quick, gloved jab to the jaw of his dizzy opponent.</I>
<IMG SRC="pic/smile.gif" WIDTH="10" HEIGHT="10" ALT="-">
<P>
<FONT SIZE="-1">No kidding -- Lorenzo called off his trip to visit Mexico City just because they told him it was extinct</FONT>
</DIV>
</DIV>
</DIV>
<DIV ALIGN="center">
<P>
<!--#include virtual="ssi/menu-p1.html" -->
</DIV>
</DIV><!-- container -->
</BODY>
</HTML>