|
-
Messed up Div tag?
Hi,
I have this code on my page
<div id="titlediv">
<div id="title">
<h1> Welcome...</h1>
</div>
</div>
and this CSS to go with it
#titlediv { background-color:#000;
width:800px;
margin-left:auto;
margin-right:auto;
margin-bottom:0px;
margin-top:0px;
padding:0px;
}
#title { background-color:#000;
width:760px;
margin-left:auto;
margin-right:auto;
color:#FFF;
font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
but when I preview in a browser there is a white space between #titlediv and the div above it. Is there any way to remove this or fix it?
Using Adobe Dreamweaver CS5
Thanks
Thomas
-
Hi there TomTom100,
and a warm welcome to these forums. 
Your code appears to be an excellent example of 'Divitis' 
Check out the symptoms here...
This will suffice...
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="language" content="english">
<meta http-equiv="Content-Style-Type" content="text/css">
<title>keep it simple</title>
<style type="text/css">
h1 {
width:760px;
padding:0 20px;
margin:0 auto;
font-family:'trebuchet ms',arial,helvetica,sans-serif;
color:#fff;
background-color:#000;
}
</style>
</head>
<body>
<h1>Welcome...</h1>
</body>
</html>
coothead
-
Thanks
So just take out the #titlediv then 
Thanks for your help!
-
No, take out both the divs, they serve no purpose.
coothead
-
Thanks
Ok, everything is sorted now 
Thanks for your help!
Regards
Thomas
-
No problem, you're very welcome. 
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|
Bookmarks