Dreamweaver MX Tutorial
Created and designed by Vivienne Trulock for ilikecake, 2005
Use CSS for layout
Continuing with the template and style sheet from before we will add more layout features to the page. To add layout features to the style sheet you have created, simply create some <div> tags in your page. You can either type them straight into the html source code, or use the 'Insert > Layer' option. <Div> tags have already been placed in the Template file you used in the previous exercise which you can use.
If using the insert layer option, remove from the source code everything but the <div id="layer1"> part. (these are done for you if you are using the sample template)
![]()
Name the tag, for example 'container'. (these are done for you if you are using the sample template)

To create a style for 'container' select the 'Use CSS selector' option and type #container. This creates the container style and means that we can now apply styles to that div tag by referencing the 'id' attribute name. Each 'id' should be unique on a particular page.
The edit window will open up and you can attach the style below to this tag.
#container - contains everything on page
Background
This specifies the background repeating striped image:
- background image: design_dream2_r1_c1.jpg
- repeat: repeat-x
- horiz position: center
- vert position: top
Box
- padding: top - 255px
- padding: left, right, bottom - 50px
Positioning
-
placement left: 0px
Other Named DIV Tags
Innercontainer, nav, content and backtop are all div tags found in the template file. These are again named using the id attribute, example: <div id="innercontainer">. Create the style in the same way as 'container' - the 'Use CSS selector' option and type #innercontainer for innercontainer, #nav for nav, #content for content and #backtop for backtop. The style settings are given below.
#innercontainer - inside container, contains everything on page
Background
This specifies the position of the header image:
- background image: design_dream2_r1_c2.jpg
- repeat: no-repeat
- horiz position: right
- vert position: top
Positioning
- position type: absolute
- width: 100%
- height: 265px
- placement top, right, left: 0px
#nav - contains navigation
Type
- case: uppercase
Background
- background color: #BDBDB0
Box
This sets the nav area to 200 pixels wide and indents all content by 10 pixels on every side.
- width: 200px
- height: auto
- float: right
- all padding: 10px
Border
- all border style: solid
- all border color: #1A1109
- all border width: 1px
Positioning
- position type: fixed
- top: 38px
- right: 34px
#content - contains page content
Box
- width: 65%
- padding top, right, left: 10px, bottom: 50px
Position
- position: absolute
- placement: left: 0px, top: 225px, right: 240px
#backtop - contains back to top link
Positioning
- position: absolute
- width: 100px
- height: 20px
- placement left: 600px, bottom: 55px
Exercise using CSS with surrounding images.