I am trying to build a two-class layout with a sidebar that is always on the left side of the page, with the main content environment centered, and when the window is resized, the centered content will end up with nav, but never move further than where they touch (what's left: 150 pixels).
Can someone help me?
Here is the CSS:
@charset "UTF-8";
body,td,th {
font-size: 16px;
font-family: Verdana, Geneva, sans-serif;
color: #000;
}
body {
background-color: #FFF;
margin-left: 0px;
margin-top: 0px;
margin-right: 15px;
margin-bottom: 0px;
}
#nav {
position: fixed;
top: 0px;
left: 0px;
width: 150px;
height: 10000px;
background-color: #D61D21;
text-align: right;
}
#nav a:link {
color: #FFF;
text-decoration: none;
}
#nav a:visited {
color: #FFF;
text-decoration: none;
}
#nav a:hover {
color: #FFF;
text-decoration: underline;
}
#main {
width: 810px;
height: 810px;
margin: 0px auto;
}
and here is the html:
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title>Nick Passaro Designs</title>
<link href="css/index.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="nav">
<a href="index.php"><img src="assets/marklogo.jpg" width="150" height="97" border="0" alt="Nick Passaro Designs"></a>
<p><a href="portfolio.php">PORTFOLIO</a> </p>
<p><a href="logos.php">LOGOS</a> </p>
<p><a href="print.php">PRINT</a> </p>
<p><a href="web.php">WEB DESIGN</a> </p>
<p><a href="photography.php">PHOTOGRAPHY</a> </p>
<p><a href="contact.php">CONTACT</a> </p>
</div>
<div id="main">
ENTER CONTENT HERE
</div>
</body>
</html>
Any help is much appreciated!
source
share