Hi Guys,
After a 3 year break I’m starting to get back into coding. I’m essentially starting from scratch and was wondering if someone could give me some support/critique for this website:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<title>Test Project</title>
<link rel="stylesheet" href="style.css" /></head>
<body>
<div class="welcome">
<span class="left">Welcome to My Test Website</span>
<span class="right">Website information</span>
</div>
<div id="header">
<a href="#"><img src="http://www.sitepoint.com/forums/images/header.gif" class="header_image" /></a>
<a href="#"><img src="http://www.sitepoint.com/forums/images/ad.gif" class="advertisement" /></a>
</div>
<div class="navigation_bar_bg">
<div class="navigation_bar_left">
<div class="navigation_bar_right">
<ul id="nav">
<li><a href="index.html">Home</a></li>
<li><a href="about.html">About</a></li>
<li><a href="portfolio.html">Portfolio</a></li>
<li><a href="contact.php">Contact</a></li>
</ul>
<span class="clear"></span>
<ul id="mininav">
<li><a href="index.html">Home</a></li>
<li><a href="about.html">About</a></li>
<li><a href="portfolio.html">Portfolio</a></li>
<li><a href="contact.php">Contact</a></li>
</ul>
</div>
</div>
</div>
</html>
/* Main body */
body {
background: #1f2731 url(images/gradient_bg.gif) repeat-x;
margin: 0px;
}
.welcome {
background: url(images/topbar.gif) top center;
height: 28px;
color: #fff;
font-family: Arial;
font-size: 12px;
padding-top: 14px;
}
/* Welcome bar and header */
.left {
margin-left: 136px;
float:left;
clear:left;
}
.right {
margin-right:136px;
float:right;
clear:right;
}
.clear {
clear:both;
height: 1px;
}
#header {
background: url(images/header_bg.gif) top left;
height: 97px;
padding: 0 129px;
}
.header_image {
margin-top: 21px;
}
.advertisement {
float:right;
margin-top: 19px;
}
/* Navigation bar */
.navigation_bar_bg {
background: url(images/nav_bg.gif) repeat-x top left;
height: 88px;
margin: 0 106px;
}
.navigation_bar_right {
background: url(images/nav_bar_right.gif) no-repeat top right;
height: 88px;
}
.navigation_bar_left {
background: url(images/nav_bar_left.gif) no-repeat top left;
}
#nav {
float: left;
margin-top: 7px;
margin-left: -25px;
}
#nav li {
float: left;
list-style: none;
height: 46px;
width: auto;
text-align: center;
}
#nav a {
display: block;
padding: 0px;
height: 46px;
line-height: 46px;
width: 82px;
text-decoration: none;
font-family: arial;
font-size: 14px;
font-weight: bold;
color: #FFF;
}
#nav a:hover {
background: url(images/nav_hover.gif) repeat-x top left;
color: #f7cf39;
}
#mininav {
float: left;
}
#mininav li {
float: left;
list-style: none;
height: 46px;
width: auto;
text-align: center;
}
#mininav a {
padding: 0px;
line-height: 32px;
text-decoration: none;
font-family: arial;
font-size: 12px;
font-weight: normal;
padding: 0 14px;
color: #5e6d75;
}
I need help with
- Clearing the floats, I’ve lost all concept of clearing and have no idea why I cannot clear the second <ul>
- Ideas on how to write cleaner code than
<div class="navigation_bar_bg">
<div class="navigation_bar_left">
<div class="navigation_bar_right">
</div>
</div>
</div>
To achieve the effect of a fluid rounded corner box.
3) General critique/thoughts as to the quality of the code.
Thanks SP