Dreamweaver Noob Help
#4
Moderator
Thread Starter
iTrader: (5)
Join Date: Nov 2001
Location: Not all those who wander are lost
Posts: 17,863
Received 0 Likes
on
0 Posts
Here is the CSS:
And the HTML:
Code:
@charset "utf-8"; body { font: 100% Verdana, Arial, Helvetica, sans-serif; margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */ padding: 0; text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */ color: #000000; background-color: #494848; } .oneColFixCtrHdr #container { width: 780px; /* the auto margins (in conjunction with a width) center the page */ border: 1px solid #000000; text-align: left; /* this overrides the text-align: center on the body element. */ background-color: #666666; margin-top: 0; margin-right: auto; margin-bottom: 0; margin-left: auto; } .oneColFixCtrHdr #header { padding: 0 10px 0 10px; /* this padding matches the left alignment of the elements in the divs that appear beneath it. If an image is used in the #header instead of text, you may want to remove the padding. */ background-color: #000000; } .oneColFixCtrHdr #header h1 { margin: 0; /* using padding instead of margin will allow you to keep the element away from the edges of the div */ padding-top: 0px; padding-right: 0; padding-bottom: 0px; padding-left: 0; } .oneColFixCtrHdr #mainContent { background-color: #666666; padding-top: 0px; padding-right: 10px; padding-bottom: 0; padding-left: 10px; vertical-align: top; } .oneColFixCtrHdr #footer { padding: 0 10px; background-color: #a4a3a3; } .oneColFixCtrHdr #footer p { margin: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse - a space between divs */ padding: 0px 0; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */ }
Code:
<!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>Blah</title> <link href="oneColFixCtrHdr.css" rel="stylesheet" type="text/css" /> <style type="text/css"> <!-- .style1 {color: #FFFFFF} .style2 { color: #FFFFFF; font-size: 14px; } --> </style> </head> <body class="oneColFixCtrHdr"> <div id="container"> <div id="header"> <h1><img src="images/logo.jpg" width="388" height="71" alt="blah" /></h1> </div> <div id="mainContent"> <h1 class="style1"> Welcome </h1> <p class="style2">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent aliquam, justo convallis luctus rutrum, erat nulla fermentum diam, at nonummy quam ante ac quam. Maecenas urna purus, fermentum id, molestie in, commodo porttitor, felis. Nam blandit quam ut lacus. Quisque ornare risus quis ligula. Phasellus tristique purus a augue condimentum adipiscing. Aenean sagittis. Etiam leo pede, rhoncus venenatis, tristique in, vulputate at, odio. Donec et ipsum et sapien vehicula nonummy. Suspendisse potenti. Fusce varius urna id quam. Sed neque mi, varius eget, tincidunt nec, suscipit id, libero. In eget purus. Vestibulum ut nisl. Donec eu mi sed turpis feugiat feugiat. Integer turpis arcu, pellentesque eget, cursus et, fermentum ut, sapien. Fusce metus mi, eleifend sollicitudin, molestie id, varius et, nibh. Donec nec libero.</p> <h2 class="style1">H2 level heading </h2> <p class="style2">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent aliquam, justo convallis luctus rutrum, erat nulla fermentum diam, at nonummy quam ante ac quam. Maecenas urna purus, fermentum id, molestie in, commodo porttitor, felis. Nam blandit quam ut lacus. Quisque ornare risus quis ligula. Phasellus tristique purus a augue condimentum adipiscing. Aenean sagittis. Etiam leo pede, rhoncus venenatis, tristique in, vulputate at, odio.</p> <!-- end #mainContent --></div> <div id="footer"> <p>© </p> <!-- end #footer --></div> <!-- end #container --></div> </body> </html>
#7
Scooby Regular
iTrader: (1)
try
css
*{margin:0; padding:0;}
body{
font:76% Verdana,Tahoma,Arial,sans-serif;
line-height:1.4em;
text-align:center;
color:#000;
background:#fff;
}
a{
color:#467aa7;
font-weight:bold;
text-decoration:none;
background-color:inherit;
}
a:hover{color:#2a5a8a; text-decoration:none; background-color:inherit;}
a img{border:none;}
p{padding:0 0 1.6em 0;}
p form{margin-top:0; margin-bottom:20px;}
#container{
width:760px;
margin:20px auto;
padding:1px 0;
text-align:left;
background:#fff;
color:#000;
border:1px dashed #a0a0a0;
}
#header{
height:110px;
width:758px;
margin:0 1px 1px 1px;
background: #fff;
color:#000;
border:1px dashed #a0a0a0;
}
#header h1{
padding:35px 0 0 20px;
font-size:2.4em;
background-color:inherit;
color:#000;
letter-spacing:-2px;
font-weight:normal;
}
#menu{
height:2.2em;
line-height:2.2em;
width:758px;
margin:0 1px;
background:#fff;
color:#000;
border:1px dashed #a0a0a0;
}
#menu li{
float:left;
list-style-type:none;
border-right:1px solid #000;
white-space:nowrap;
padding: 0px 10px 0px 10px;
}
#menu li a{
display:block;
padding:0 10px;
font-size:0.8em;
font-weight:normal;
text-transform:uppercase;
text-decoration:none;
background-color:inherit;
color: #000;
}
* html #navigation a {width:1%;}
#menu .selected,#menu a:hover{
background: #fff;
color: #CCCCCC;
text-decoration:none;
}
#content{
float:left;
width: 720px;
font-size:0.9em;
padding:20px 0 0 20px;
border:1px dashed #a0a0a0;
}
#footer{
clear:both;
width:758px;
padding:5px 0;
margin:0 1px;
font-size:0.9em;
color:#000;
background:#fff;
border:1px dashed #a0a0a0;
}
HTML -
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title></title>
<link rel="stylesheet" href="css.css" />
</head>
<body>
<div id="container" >
<div id="header">
Header
</div>
<div id="menu">
<ul>
<li class="selected"><a href="#">Home</a></li>
<li><a href="#">another</a></li>
<li><a href="#">and another</a></li>
<li><a href="#">and another</a></li>
<li><a href="#">last one</a></li>
</ul>
</div>
<div id="main">
<p> </p>
<p>Info</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
</div>
<div id="footer">
<p class="small">Footer</p>
</div>
</div>
</body>
</html>
css
*{margin:0; padding:0;}
body{
font:76% Verdana,Tahoma,Arial,sans-serif;
line-height:1.4em;
text-align:center;
color:#000;
background:#fff;
}
a{
color:#467aa7;
font-weight:bold;
text-decoration:none;
background-color:inherit;
}
a:hover{color:#2a5a8a; text-decoration:none; background-color:inherit;}
a img{border:none;}
p{padding:0 0 1.6em 0;}
p form{margin-top:0; margin-bottom:20px;}
#container{
width:760px;
margin:20px auto;
padding:1px 0;
text-align:left;
background:#fff;
color:#000;
border:1px dashed #a0a0a0;
}
#header{
height:110px;
width:758px;
margin:0 1px 1px 1px;
background: #fff;
color:#000;
border:1px dashed #a0a0a0;
}
#header h1{
padding:35px 0 0 20px;
font-size:2.4em;
background-color:inherit;
color:#000;
letter-spacing:-2px;
font-weight:normal;
}
#menu{
height:2.2em;
line-height:2.2em;
width:758px;
margin:0 1px;
background:#fff;
color:#000;
border:1px dashed #a0a0a0;
}
#menu li{
float:left;
list-style-type:none;
border-right:1px solid #000;
white-space:nowrap;
padding: 0px 10px 0px 10px;
}
#menu li a{
display:block;
padding:0 10px;
font-size:0.8em;
font-weight:normal;
text-transform:uppercase;
text-decoration:none;
background-color:inherit;
color: #000;
}
* html #navigation a {width:1%;}
#menu .selected,#menu a:hover{
background: #fff;
color: #CCCCCC;
text-decoration:none;
}
#content{
float:left;
width: 720px;
font-size:0.9em;
padding:20px 0 0 20px;
border:1px dashed #a0a0a0;
}
#footer{
clear:both;
width:758px;
padding:5px 0;
margin:0 1px;
font-size:0.9em;
color:#000;
background:#fff;
border:1px dashed #a0a0a0;
}
HTML -
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title></title>
<link rel="stylesheet" href="css.css" />
</head>
<body>
<div id="container" >
<div id="header">
Header
</div>
<div id="menu">
<ul>
<li class="selected"><a href="#">Home</a></li>
<li><a href="#">another</a></li>
<li><a href="#">and another</a></li>
<li><a href="#">and another</a></li>
<li><a href="#">last one</a></li>
</ul>
</div>
<div id="main">
<p> </p>
<p>Info</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
</div>
<div id="footer">
<p class="small">Footer</p>
</div>
</div>
</body>
</html>
Thread
Thread Starter
Forum
Replies
Last Post
BoxerFlat4
Computer & Technology Related
9
04 November 2002 04:36 PM