•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the HTML and CSS section within the Web Development category of DaniWeb, a massive community of 427,255 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,208 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our HTML and CSS advertiser: Lunarpages Web Hosting
Views: 684 | Replies: 2
![]() |
•
•
Join Date: Sep 2006
Posts: 10
Reputation:
Rep Power: 3
Solved Threads: 0
So I decided I would try to make a website that is completely valid, and very simple. So far this is working out well, but there is a white space in between the main content area and the navigation area that I don't know how to get rid of.
Here is the code:
HTML
CSS
Here is the problem
[img]http://farm3.static.flickr.com/2173/2371699404_519528f0cd_o.jpg[/img]
Here is the code:
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>My Portfolio</title>
<style type="text/css">
@import url('style.css');
</style>
</head>
<body>
<div id="wrapper">
<div id="header">
<h1>The Portfolio</h1>
</div>
<div id="nav">
<ul>
<li><a href="home">Home</a></li>
<li><a href="about">About</a></li>
<li><a href="contact">Contact</a></li>
</ul>
</div>
<div id="main">
<h1>This is a header</h1>
<p>This is a paragraph where words normally go. People tend to read words.</p>
<h2>Part one: Heres a start</h2>
<p>It is important that you know the letters asdf and jkl; because these are the keys you should have you fingers on at all times.</p>
<p>If you find that you hands are in another place, then you are a noob</p>
<h2>Part two: how not to be a noob</h2>
<p>Juz don typ wid bad spelz. Some people use lorerd isbum delorio what ever its called to fill up random text but now me!</p>
<p>I thought that I would put mroe text into this example because after all who doesnt like realding a lot of text on the screen. Its cool that way, and I right, idk. STFU</p>
</div>
<div id="footer">
<p>The Portfolio is a website of all my works, under the Creative Commons License</p>
<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/us/">
<img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-nc-sa/3.0/us/80x15.png"/>
</a>
</div>
</div>
</body>
</html>CSS
/*
Main Elements
*/
body {
text-align: center;
background-color: black;
}
a {
color: #75a1ec;
text-decoration: none;
padding: 0;
margin: 0;
}
a:hover{
color: #4137cd;
text-decoration: none;
padding: 0;
margin: 0;
}
h1{
font-style:normal; /*normal, italic, oblique*/
font-variant:small-caps; /*normal, small-caps*/
font-weight:bolder; /*norma, bold, bolder, lighter, or 100-900 */
font-size:2em; /*xx-small, x-small, small, medium, large, x-large, xx-large, smaller, larger, %*/
line-height: 1em; /*normal, number, %, length */
font-family: "Arial Black",serif; /*arial, "lucida console", sans-serif*/
color: white;
margin: .8em .1em .5em .1em;
}
h2 {
font: normal normal bold 1em "Arial Black";
line-height: 1em;
margin: 1em .1em 1em .1em;
color: white;
}
p{
font-style:normal; /*normal, italic, oblique*/
font-variant:normal; /*normal, small-caps*/
font-weight:normal; /*norma, bold, bolder, lighter, or 100-900 */
font-size:1em; /*xx-small, x-small, small, medium, large, x-large, xx-large, smaller, larger, %*/
line-height: 1em; /*normal, number, %, length */
font-family: arial, serif, sans-serif; /*arial, "lucida console", sans-serif*/
color: white;
margin: 0 2em 0 2em;
}
/*
Div Sections
*/
#wrapper {
background-color: white;
width: 600px;
padding: 0;
margin:0 auto 0 auto;
text-align: center;
border: 1px solid white;
}
#header {
background: #ffffff url('header.jpg') no-repeat top left;
width: 600px;
height: 100px;
border-bottom: 1px solid black;
margin: 0;
padding: 0;
}
#header h1{
font-style:normal; /*normal, italic, oblique*/
font-variant:normal; /*normal, small-caps*/
font-weight:bolder; /*norma, bold, bolder, lighter, or 100-900 */
font-size:3em; /*xx-small, x-small, small, medium, large, x-large, xx-large, smaller, larger, %*/
line-height: 1em; /*normal, number, %, length */
font-family: "Arial Black",serif; /*arial, "lucida console", sans-serif*/
text-align: center;
color: white;
padding: 25px 0 0 0;
margin: 0;
}
#nav{
width: 600px;
height: 1em;
margin: 0;
padding: 0;
background-color: black;
/*
background: #ffffff url('navbr') repeat-x top left;
*/
overflow: hidden;
}
#nav ul{
padding:0;
margin: 0;
float: left;
}
#nav li{
margin: 0 5px 0 5px;
padding: 0;
display: inline;
}
#nav a{
margin: 0;
padding: 0;
}
#main{
margin: 0;
padding: 0;
background-color: black;
text-align: left;
}
#footer{
text-align: center;
clear: both;
margin: 0;
padding: 0;
background-color: black;
border-top: 1px solid white;
height: 3em;
}
#footer p{
color: white;
margin: 0 0 0 0;
padding: .8em 0 0 0;
font-weight:normal;
font-size: .7em;
}
object embed{
margin: .5em 2.5em .5em 2.5em;
}Here is the problem
[img]http://farm3.static.flickr.com/2173/2371699404_519528f0cd_o.jpg[/img]
•
•
Join Date: Jan 2008
Location: Bali - Indonesia
Posts: 62
Reputation:
Rep Power: 1
Solved Threads: 8
•
•
•
•
h1{ font-style:normal; /*normal, italic, oblique*/ font-variant:small-caps; /*normal, small-caps*/ font-weight:bolder; /*norma, bold, bolder, lighter, or 100-900 */ font-size:2em; /*xx-small, x-small, small, medium, large, x-large, xx-large, smaller, larger, %*/ line-height: 1em; /*normal, number, %, length */ font-family: "Arial Black",serif; /*arial, "lucida console", sans-serif*/ color: white; margin: .8em .1em .5em .1em; }
you need to change h1 margin tjl30, that white space is cause by top margin of your h1
just change it to
margin: 0 .1em .5em .1em;
![]() |
•
•
•
•
•
•
•
•
DaniWeb HTML and CSS Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- unwanted space (HTML and CSS)
- White Space Between Table Images (HTML and CSS)
- Searching in documents... (C++)
- Complete List of Mysql Commands for PHP tokenization script. (PHP)
- writing a script (Shell Scripting)
- Explorer Malfunction In Win 98se (Windows 9x / Me)
Other Threads in the HTML and CSS Forum
- Previous Thread: Hi, I want to link one audio file to image
- Next Thread: Poster's Image representing the post?


Linear Mode