Lola8
05-15-2008, 10:51 PM
I am new to web design and am confused about how page length works. My page is set up as such: a white rectangular body that displays content and is surrounded by a gray background (which fills the rest of the browser).
I tried to insert a rather long text into one of the pages within my site. I expected the white section to lengthen according to the amount of text I inserted, but instead the text overflowed onto the gray part.
How do I make the main body of my page lengthen according to the amount of content that it is meant to display? Do I set a length? Why did the white part remain the same size and the text overflow onto the gray?
Thanks for your time/help.
Here is my code;
XHTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>writing/title>
<link rel="stylesheet" type="text/css" href="../style.css" />
<meta name="generator" content="BBEdit 8.7" />
</head>
<body>
<div id="wrap">
<div id="header">
<p id="navbuttons">
<a href="../index.html"class="current">home</a>
<a href="artists.html">artists</a>
<a href="writing.html">writing</a>
<a href="listings_news.html">news+listings</a>
<a href="links.html">links</a>
<a href="about.html">about</a>
<a href="contact.html">contact</a>
</div> <!-- end #header -->
<div id="main">
<div class="new">
<h1> New </h1>
</div> <!-- end .new -->
<div class="essays">
<h1>Essays</h1>
<p><a href="kiki.html">Daniil Leidermann: <br/> Living or Dead: Kiki Smith, the Abject and the Grotesque <a/></p>
</div> <!-- end .essays -->
<div class="reviews">
<h1>Reviews</h1>
</div> <!-- end .reviews -->
</div> <!-- end #main -->
</div> <!-- end #wrap -->
</body>
</html>
************************************************
CSS:
/* alignment ------------- */
html, body, main {
height: 100%;
}
body {margin:0;padding:0; background: #717D7D; /*overflow:hidden;*/}
#wrap {
max-width: 900px;
min-width: 480px;
background:url(header_graphic.jpg) no-repeat;
width:90%;
margin:20px auto;
padding:30px 20px 0 0;
min-height: 100%;
}
#navbuttons {position:relative;top:-.6em;left:14em}
#main {float:left;
width:75%;
}
/* index ------------- */
.upnow h1 {margin-left:80px; margin-top:70px;}
.table p {margin-left:90px; margin-top:20px;}
.photo img {left:3em;position:relative; margin:20px;margin-top:0px;}
.photo img {border:none;}
/* artists ------------- */
.feature h1 {margin-left:100px;margin-top:70px;}
#album {position:relative;margin-top:50px;margin-left:75px;}
/* writing ------------- */
.new h1 {position:relative;margin-top:50px;margin-left:100px;}
.essays {position:relative;margin-top:30px;margin-left:100px;}
.reviews {position:relative;margin-top:2em;margin-left:100px;}
/* about ------------- */
.about p {position:relative;margin-top:100px;margin-left:100px;width:500px;}
.about2 p {position:relative;margin-left:100px;width:500px;}
/* links ------------- */
.links {text-align:center;margin-left:190px;margin-top:100px;position:relative;}
/* contact ------------- */
.info p {position:relative;margin-top:100px;margin-left:100px;width:500px;}
/*news and listings*/
table, td {border:none}
.news {width:200px;position:relative;margin-top:50px;margin-left:100px;}
#sidebar {position: absolute; left: 60%; top: 10em; width: 220px;background:#6699CC;padding:4px;align:top; border: 2px dashed black;}
/* text styles ------------- */
#navbuttons {font-family: "Futura", sans-serif; font-weight:lighter;right:-6em;font-size:14px;color:black;text-transform:uppercase;word-spacing:20px}
a {text-decoration:none;color:black;hover:none}
a:link {color:black;}
a:visited {color:#333333;}
a:hover, a:focus {color:red;text-decoration:underline;}
a:active {color:red;}
a:hover.current {color:gray;cursor:default}
/* index ------------- */
.upnow h1 {font-family: "Futura", sans-serif;font-weight:lighter;font-size: 14px;text-transform:uppercase;}
.table p {font-family: "Futura", sans-serif;font-weight:lighter;font-size: 14px; white-space:non-wrapping;}
/* artists ------------- */
.feature h1 {font-family: "Futura", sans-serif;font-weight:lighter;font-size: 14px;text-transform:uppercase;}
/* writing ------------- */
.new h1 {font-family: "Futura", sans-serif;font-weight:lighter;font-size: 18px;text-transform:uppercase;}
.essays h1 {font-family: "Futura", sans-serif;font-weight:lighter;font-size: 14px;text-transform:uppercase;}
.essays p {font-family: "Futura", sans-serif;font-weight:lighter;font-size: 14px;}
.reviews h1 {font-family: "Futura", sans-serif;font-weight:lighter;font-size: 14px;text-transform:uppercase;}
/* iframe ------------- */
/*
iframe {
position: absolute; left: 60%; top: 10em; width: 200px;
scrollbar-face-color:##FFFFFF;
scrollbar-shadow-color:#d7d7d7;
scrollbar-highlight-color:#d7d7d7;
scrollbar-3dlight-color:#d7d7d7;
Scrollbar-Darkshadow-Color:#d7d7d7;
scrollbar-arrow-color:#7a7a7a;
scrollbar-track-color:#FFFFFF;
} */
/* about ------------- */
.about p {font-family: "Futura", sans-serif;font-weight:lighter;font-size: 14px;}
.about2 p {font-family: "Futura", sans-serif;font-weight:lighter;font-size: 14px;}
/* links ------------- */
.links h1, h2 {font-family: "Futura", sans-serif;font-weight:lighter;font-size: 16px;text-transform:uppercase;}
.links p {font-family: "Futura", sans-serif;font-weight:lighter;font-size: 14px;}
/* contact ------------- */
.info p {font-family: "Futura", sans-serif;font-weight:lighter;font-size: 14px;}
/*news and listings*/
.news h1 {font-family: "Futura", sans-serif;font-size:18px;font-weight:lighter;text-transform:uppercase;}
.news p {font-family: "Futura", sans-serif;font-size:14px;font-weight:lighter;}
.news p3
#sidebar h2, p {font-family: "Futura", sans-serif;font-size:14px;font-weight:lighter;}
h2 {text-align:center;}
I tried to insert a rather long text into one of the pages within my site. I expected the white section to lengthen according to the amount of text I inserted, but instead the text overflowed onto the gray part.
How do I make the main body of my page lengthen according to the amount of content that it is meant to display? Do I set a length? Why did the white part remain the same size and the text overflow onto the gray?
Thanks for your time/help.
Here is my code;
XHTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>writing/title>
<link rel="stylesheet" type="text/css" href="../style.css" />
<meta name="generator" content="BBEdit 8.7" />
</head>
<body>
<div id="wrap">
<div id="header">
<p id="navbuttons">
<a href="../index.html"class="current">home</a>
<a href="artists.html">artists</a>
<a href="writing.html">writing</a>
<a href="listings_news.html">news+listings</a>
<a href="links.html">links</a>
<a href="about.html">about</a>
<a href="contact.html">contact</a>
</div> <!-- end #header -->
<div id="main">
<div class="new">
<h1> New </h1>
</div> <!-- end .new -->
<div class="essays">
<h1>Essays</h1>
<p><a href="kiki.html">Daniil Leidermann: <br/> Living or Dead: Kiki Smith, the Abject and the Grotesque <a/></p>
</div> <!-- end .essays -->
<div class="reviews">
<h1>Reviews</h1>
</div> <!-- end .reviews -->
</div> <!-- end #main -->
</div> <!-- end #wrap -->
</body>
</html>
************************************************
CSS:
/* alignment ------------- */
html, body, main {
height: 100%;
}
body {margin:0;padding:0; background: #717D7D; /*overflow:hidden;*/}
#wrap {
max-width: 900px;
min-width: 480px;
background:url(header_graphic.jpg) no-repeat;
width:90%;
margin:20px auto;
padding:30px 20px 0 0;
min-height: 100%;
}
#navbuttons {position:relative;top:-.6em;left:14em}
#main {float:left;
width:75%;
}
/* index ------------- */
.upnow h1 {margin-left:80px; margin-top:70px;}
.table p {margin-left:90px; margin-top:20px;}
.photo img {left:3em;position:relative; margin:20px;margin-top:0px;}
.photo img {border:none;}
/* artists ------------- */
.feature h1 {margin-left:100px;margin-top:70px;}
#album {position:relative;margin-top:50px;margin-left:75px;}
/* writing ------------- */
.new h1 {position:relative;margin-top:50px;margin-left:100px;}
.essays {position:relative;margin-top:30px;margin-left:100px;}
.reviews {position:relative;margin-top:2em;margin-left:100px;}
/* about ------------- */
.about p {position:relative;margin-top:100px;margin-left:100px;width:500px;}
.about2 p {position:relative;margin-left:100px;width:500px;}
/* links ------------- */
.links {text-align:center;margin-left:190px;margin-top:100px;position:relative;}
/* contact ------------- */
.info p {position:relative;margin-top:100px;margin-left:100px;width:500px;}
/*news and listings*/
table, td {border:none}
.news {width:200px;position:relative;margin-top:50px;margin-left:100px;}
#sidebar {position: absolute; left: 60%; top: 10em; width: 220px;background:#6699CC;padding:4px;align:top; border: 2px dashed black;}
/* text styles ------------- */
#navbuttons {font-family: "Futura", sans-serif; font-weight:lighter;right:-6em;font-size:14px;color:black;text-transform:uppercase;word-spacing:20px}
a {text-decoration:none;color:black;hover:none}
a:link {color:black;}
a:visited {color:#333333;}
a:hover, a:focus {color:red;text-decoration:underline;}
a:active {color:red;}
a:hover.current {color:gray;cursor:default}
/* index ------------- */
.upnow h1 {font-family: "Futura", sans-serif;font-weight:lighter;font-size: 14px;text-transform:uppercase;}
.table p {font-family: "Futura", sans-serif;font-weight:lighter;font-size: 14px; white-space:non-wrapping;}
/* artists ------------- */
.feature h1 {font-family: "Futura", sans-serif;font-weight:lighter;font-size: 14px;text-transform:uppercase;}
/* writing ------------- */
.new h1 {font-family: "Futura", sans-serif;font-weight:lighter;font-size: 18px;text-transform:uppercase;}
.essays h1 {font-family: "Futura", sans-serif;font-weight:lighter;font-size: 14px;text-transform:uppercase;}
.essays p {font-family: "Futura", sans-serif;font-weight:lighter;font-size: 14px;}
.reviews h1 {font-family: "Futura", sans-serif;font-weight:lighter;font-size: 14px;text-transform:uppercase;}
/* iframe ------------- */
/*
iframe {
position: absolute; left: 60%; top: 10em; width: 200px;
scrollbar-face-color:##FFFFFF;
scrollbar-shadow-color:#d7d7d7;
scrollbar-highlight-color:#d7d7d7;
scrollbar-3dlight-color:#d7d7d7;
Scrollbar-Darkshadow-Color:#d7d7d7;
scrollbar-arrow-color:#7a7a7a;
scrollbar-track-color:#FFFFFF;
} */
/* about ------------- */
.about p {font-family: "Futura", sans-serif;font-weight:lighter;font-size: 14px;}
.about2 p {font-family: "Futura", sans-serif;font-weight:lighter;font-size: 14px;}
/* links ------------- */
.links h1, h2 {font-family: "Futura", sans-serif;font-weight:lighter;font-size: 16px;text-transform:uppercase;}
.links p {font-family: "Futura", sans-serif;font-weight:lighter;font-size: 14px;}
/* contact ------------- */
.info p {font-family: "Futura", sans-serif;font-weight:lighter;font-size: 14px;}
/*news and listings*/
.news h1 {font-family: "Futura", sans-serif;font-size:18px;font-weight:lighter;text-transform:uppercase;}
.news p {font-family: "Futura", sans-serif;font-size:14px;font-weight:lighter;}
.news p3
#sidebar h2, p {font-family: "Futura", sans-serif;font-size:14px;font-weight:lighter;}
h2 {text-align:center;}