Now that we have designed the first 2 parts of our CSS Website, its time to create the content area of our layout.
1. If you have not taken the first 2 parts of this tutorial, you should go take them now. If you are ready to continue, insert the following two classes into your CSS Styles:
|
td.content {
width: auto; padding: 0px 5px 5px 5px; font-size: 10px; } td.content div.title { background-color: #FFF; color: #000; border: none; font-size: 18px; font-weight: bold; |
2. The first class will make the cell with all of our main content automatically adjust width to the resolution of the viewers display, and pad the right, bottom, and left sides by 5 pixels. It will also make the main font size 10 pixels. The second class "title" is a class that we can use to make headers. It will make a large bold font instead of our small 10 pixel font.
3. After you end your cell with your left navigation menu "</td>", start a new cell like this:
|
<td class="content">
<div class="title">Content Header</div> Main content goes here! This is just some random text that you can change. Do not leave this dummy text on your actual site. This is not meant to be read, it is meant to be removed. Write news, articles, or whatever other kind of content you would like here.</td> |
4. This will begin our new cell using our content class, then use the title class to make a bold heading that says "Content Header", and then it will display some dummy text that you can replace with real content later. Your content area should look similar to this:
5. And the full code so far should look like this:
|
<html>
<head> <meta http-equiv="Content-Language" content="en-us"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>My First CSS WebSite</title> <style type="text/css" media="all"> body { margin: 0; padding: 0; color: #000; background-color: #FFF; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 100%; } .header { background-color: #9A060B; color: #FFF; font-size: 24pt; font-weight: bold; padding: 5px; border-bottom: 1px solid #000; } .quote { width: 100%; background-color: #EEE; color: #000; font-size: 8pt; font-weight: bold; padding: 2px; border-bottom: 1px solid #000; text-align: right; } table#main { height: 100%; vertical-align: top; } table#main td { vertical-align: top; } td.leftnav { background: #9D4631; width: 175px; border-right: 1px solid #000; padding: 0px; color: #FFF; font-size: 10px; text-align: center; } td.leftnav div.header { background: #BD1219; color: #FFF; padding: 3px; border-bottom: 1px solid #000; font-size: 12px; font-weight: bold; text-align: center; } td.leftnav div.menu { background: #9B2E1B; padding: 0px; border-bottom: 1px solid #000; } td.leftnav div.menu a { display: block; padding: 2px; margin: 0px; font-size: 10px; color: #FFF; border-style:none; text-align: left; } td.leftnav div.menu a:hover { background: #C58873; color: #FFF; text-align: left; } td.content { width: auto; padding: 0px 5px 5px 5px; font-size: 10px; } td.content div.title { background-color: #FFF; color: #000; border: none; font-size: 18px; font-weight: bold; } </style> </head> <body> <div class="header">CSS Website</div> <div class="quote">Because CSS is Awesome</div> <table cellspacing="0" id="main"> <tr> <td class="leftnav"> <div class="header">Menu 1</div> <div class="menu"> <a href="#">Link 1</a> <a href="#">Link 2</a> <a href="#">Link 3</a> <a href="#">Link 4</a> <a href="#">Link 5</a> </div> <div class="header">Menu 2</div> <div class="menu"> <a href="#">Link 1</a> <a href="#">Link 2</a> <a href="#">Link 3</a> <a href="#">Link 4</a> <a href="#">Link 5</a> </div> <div class="header">Menu 3</div> <div class="menu"> <a href="#">Link 1</a> <a href="#">Link 2</a> <a href="#">Link 3</a> <a href="#">Link 4</a> <a href="#">Link 5</a> </div> <br> This is just a place where you can write some brief news, updates, and possibly insert some affiliates or links. You can even put more parts of your navigation menu here! </td> <td class="content"> <div class="title">Content Header</div> Main content goes here! This is just some random text that you can change. Do not leave this dummy text on your actual site. This is not meant to be read, it is meant to be removed. Write news, articles, or whatever other kind of content you would like here.</td> </tr> </table> </body> </html> |
So far so good!
Continue to Part 4 for instructions on how to design the right navigation menu!








