Basics of Div Tags
Create a new HTML file in Macromedia Dreamweaver 8 (Ctrl+N).
Then create a new CSS file by following the same steps as above, just make sure you select "CSS" instead of "HTML". Then save the two newly created files in the same folder. For example "my website". Save the HTML file as index.html and the CSS file as css.css.
The first thing we want to do, is to set the padding and the margins on the index site to 0. This is done using the CSS file we just created. Open your CSS file.
On line 3, type the same as I've done.
Now, go back to your html page and import your stylesheet.
Then switch to code view.
Inside the body tags, write this:
This will be the main container of the page.Then, inside the newly created div tag, create another one. Like this:
Then, underneath the header div, still inside the main-wrap, write three more divs.
You should also fill the div tags with some placeholder text like this:
If you return to the design view, you will see four of your div tags. This is because you filled them with text. Empty div tags will be 0px in height if you don't set the height using CSS.
It doesn't really look like a web site yet. But after some work in the CSS sheet we will get closer to a full site.
Open your CSS sheet.
On a new line, type:
This will set the width of the main-wrap div to 800px. The margin property is set to auto. This will center the div tag.
If you go back to the html page, you can see the changes we made.
It should look like this:
Go back to your CSS sheet and write this:
That's how you set up your divs for a site. If you have any questions ask in the forums, we are there to help you!