-
Step 1
Open a text editor document and save it as mystyle.css.
-
Step 2
Set the margin and padding of the body element with the following code. Because some browsers do not default to zero, they must be physically set. Color must also be set for the same basic reason that not all browsers default to white. What follows is the CSS code for the beginning of the page: html,body{margin:0;padding:0;background:#FFF}.
-
Step 3
Next, set the size for the body text. The code for this example is: body{font: 76% arial,sans-serif}.
-
Step 4
The next command sets the paragraph margin: p{margin:0 10px 10px}.
-
Step 5
The next command will give the page its container or main section, inside of which you put all of the other pieces of your page.This example uses the following code: div#container{width:1024px;height:1800px;margin:0 auto}.
-
Step 6
On the left hand side of the navigation bar, add a division. The code is as follows: div#navigation{float:left;width:250px;height:100%}.
-
Step 7
Now let's define the content section of the page. This is the middle section of the page where you add your main content: div#content{float:left;width:700px;height:1500px}.
-
Step 8
For the right hand column, you add code similar to this: div#extra{float:right;width:250px;height:1500px}.
-
Step 9
Adding headers and footers are handled in the same manner. The footer code for this page would be div#footer{clear:all;width:1020px;height:300px}. Add a header to the page that allows for your logo. The code for this header is: div#header h1{height:80px;line-height:80px;margin:0;
padding-left:10px;background: #EEE;color: #79B30B}. -
Step 10
Within the CSS file you should also define your header fonts. They are denoted as h1{color:#ff0000;height:80px;line-height:80px;}; h2 through h6 can also be defined (this code defines the color as well as the height of the font).
-
Step 11
Save this document and reference it in your html document to pull the styles into your website.










