I have 3 divs total in the document. One the serves as the header (div#navigation_bar) which is in the body with a width of 100%, one inside div#navigation_bar (div#navigation_bar_content) which has a width of 920 px and is the same height as the div#navigation_bar, and one in the body with a width of 920 px and 750 px as the height (div#content). I gave div#navigation_bar the float left property and then gave div#content the clear left property and gave it a top margin of zero and left and right margin of auto, so the overall result is that the div#content appears right below the div#navigation_bar and is centered. So I inserted a header 1 in the div#content with the text "Welcome" then formatted that with an h1 tag style. I set all the margins the same for it and it worked in design view after I applied it. But when I tested it in every browser the top margin for "Welcome" was ignored and was like 5 px from the top border of div#content. It only ignores the top margin for some reason. This is my first site so bear with me ![]()
Edit: I use dreamweaver CS5.5
Answers to layout questions are contained in your HTML and CSS code. For quick answers, upload your page to your remote site and post a URL for us to see in our browsers.
A less preferred 2nd option is to copy & paste your code (all of it) into a web forum reply (don't use email for this as code won't come through.)
Nancy O.
Alt-Web Design & Publishing
Web | Graphics | Print | Media Specialists
Well I cant upload it being as I dont have a site... but I can give u both the html and css coding but you wont be able to see the images of course.
html: http://pastie.org/4098825
css: http://pastie.org/4098826
I think the problem has to do with the fact that the header is liquid and the content is fixed :/
I can't tell much from the code you posted.
Copy & Paste this into a new, blank document. Adjust CSS colors & backgrounds to suit. Note: I used embedded CSS here for expediency. You can move CSS styles to your external file.
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Cento Media Home</title>
<style type="text/css">
body {
font-family:Georgia,"Times New Roman", Times, serif;
font-size: 16px;
background-color: #000;
background-image: url(space2.jpg);
color: #FFF;
width: 920px;
margin:0 auto;
border: 4px solid silver;
}
#header {
background-color: #666;
overflow:hidden; /**to control floats**/
}
#header a img {
float:left;
padding: 20px;
border:none;
}
/**top menu**/
#nav ul {
padding:0;
margin:0;
}
#nav li {
list-style:none;
margin:0;
padding:0;
font-size: 25px;
text-align:center;
}
#nav li a {
float:left;
display:block;
width: 8em;
color: red;
text-decoration:none;
background-color: #CCC;
border: 1px solid #FFF;
}
#nav li a:visited {color: #333}
#nav li a:hover,
#nav li a:active,
#nav li a:focus {
color: #FFF;
background: red;}
/**end top menu**/
#content {
background-image: url(content.png);
margin:0;
padding:30px 12px 0 12px;
}
#footer {
margin:0;
padding:0;
border-top: 3px solid #CCC;
background-color: #FFF;
color: #000;
text-align:center;
font-size: 12px;
}
/**TEXT STYLES**/
p {font-size: 16px;}
h1 {font-size: 50px;}
h2 {font-size: 25px;}
h3 {font-size: 18px}
</style>
</head>
<body>
<div id="header">
<a href="#"><img src="logo.png" alt="logo" width="116" height="85"/></a>
<h1>Welcome to Cento Media</h1>
<ul id="nav">
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Contact</a></li>
<!--end nav--></ul>
<!--end header--></div>
<div id="content">
<h2>Heading 2</h2>
<p>Description goes here...</p>
<h3>Heading 3</h3>
<p>Description goes here...</p>
<h4>Unordered List:</h4>
<ul>
<li>some list item</li>
<li>some list item</li>
<li>some list item</li>
<li>some list item</li>
</ul>
<h4>Ordered List:</h4>
<ol>
<li>some list item</li>
<li>some list item</li>
<li>some list item</li>
<li>some list item</li>
</ol>
<!--end content --></div>
<div id="footer">
© 2012 your footer message goes here...
</div>
</body>
</html>
Nancy O.
Alt-Web Design & Publishing
Web | Graphics | Print | Media Specialists
North America
Europe, Middle East and Africa
Asia Pacific