Michele Gaggia - Web Design - Lesson 4
Lesson 1 | Lesson
2 | Lesson 3 | Lesson
4 | Lesson 5
Web Design - Page Layout
Using Tables and Layers
To precisely position text and graphic elements in a HTML document it is necessary
to create "invisible tables" that serve as a grid (Raster) to "hold"
the desired objects in place.
Dreamweaver uses two different ways to work with tables:
- the standard mode ("Standardansicht"), were tables
are defined in a "classical" way (menu "Einfügen >
Tabelle" - [Strg+Alt+T] ) with number of rows and columns, width in pixel
or %, cell spacing and padding etc.
- the layout mode ("Layoutansicht"), where tables
and cells can be freely drawn and modified. You switch between the two modes
using the toolbox "Einfügen" (if this is not open, use "Fenster
> Einfügen" - [Strg+F2] ), tab "Layout", "Standardansicht"
or "Layoutansicht". You create a table using the "Layouttabelle
zeichnen" button, and you can add cells with the "Layoutzelle zeichnen"
button.
To spare time during the design phase it is convenient to first draw tables
in layout mode, as in this way you can create very quickly complex
looking tables, with cells that are not vertically or horizontally aligned with
each other. Later you can switch back to standard mode, and keep filling
the tables with text and picture elements. Of course you should create a table
that fits the graphic objects you want to use, or create graphic objects that
fit the table you created.
You can also export a graphic with "slices" from Fireworks, and Fireworks
will automatically create a HTML table to perfectly fit the slices you created
(see Lesson 3 "Processing Pictures for Web
Publishing").
To change all the table or cell properties, you have to switch back to standard
mode.
For being invisible, a table must have a border width of "0" (properties
toolbox, "Rahmen"). When creating tables in layout mode, their standard
border is always "0".
Of course you can also make parts or all the tables "visible": just
select a cell or the whole table and define a background color (properties toolbox,
"HgF" = Hintergrundfarbe)
Exercise 7.1: Dreamweaver - switching between layer and table layout,
creating tables and cells
- create a new HTML file (Strg+N, "Allgemein > Einfache Seite >
HTML")
- click on the "Layout" tab of the "Einfügen" toolbox
(usually on top) and switch to layout mode ("Layoutansicht")
- using the "Layouttabelle zeichnen" button of the toolbox create
a table (about 600 pixel wide)
- using the "Layoutzelle zeichnen" button of the toolbox add different
sized cells inside the table
- create first simple, then more complex table and layout combinations
Exercise 7.2: Dreamweaver - modifying properties table and cell properties,
adding text and formatting with CSS styles
- using the output of Exercise 7.1, change the background color of cells and
tables using the properties box (Eigenschaften).
Note: you have to mark tables and cells precisely on the border! If cou click
in the center of the cell you can only access the text formatting properties.
- add text to the table cells and use formatting options - for example, add
a CSS style that define the text within a table (to do this, you have to redefine
the <td> table cell tag)
- change the cell padding ("Zellauffüllung") and cell spacing
("Zellraum") global parameters for this table; note the difference
between spacing and padding and check the corresponding values in the HTML
code; note: you have to mark exactly the table border to change the "Zellauffüllung"
and "Zellraum" values in the properties box.
- switch back to standard mode ("Standardansicht")
- if you want, you can try to change the border thickness and color settings
for the table (only available in standard mode - "Rahmen" parameter).
Note: normally you will want the border to remain invisible (value "0")
so that you can use it as an invisible grid to position elements.
Website Standard Layouts and Screen Resolution
There are several kinds website standard layouts. A layout can
be defined by a table of the corresponding width/height or by separate HTML-frames
(see "using Frames" under). Here some examples:
- main navitation menu on the left side or frame, optional sub menu on top
(examples: http://www.didgeridoo.at
, http://www.translators-fusion.com)
| graphic logo - website title |
| main nav. menu |
sub menu |
| page title
main page content main page content main page content main page content
main page content main page content main page content |
| page footer (copyright notice, actualization
date, etc.) |
- "portal" type: top and side nav. menus, three main columns, main
content in the middle column
(example: http://www.phpnuke.org
, http://www.phpnuke-service.de
, http://www.amazon.com
)
| graphic logo - website title |
| main navigation menu |
| sub menus |
page title
main page content main page content main page content main page content
main page content main page content main page content |
sub menus |
| page footer (copyright notice,
actualization date, etc.) |
In addition to these "standard" layout types, there a lot of possible
"freestyle" layouts, some of which can be very amusing to "explore"
but that are not necessarily the best option if we want the user to find the
desired information in the easiest way and shortest time possible. Of
course it is also possible to create original layouts that are also easy to
navigate. Just a few examples:
Page width in pixel - It is usually best to make a website fit into
standard resolutions, therefore tables should not be wider than the target screen
resolution. As some OS elements (window borders, scroll bars) use additional
space, it is necessary to leave about 40 pixel free for a table to fit. Examples:
- to fit a 640 x 480 resolution, the table should be about 600 pixels wide
- to fit a 800 x 600 resolution, the table should be 750-760 pixels wide
- to fit a 1024 x 768 resolution, the table should be about 970 pixels wide
Nowadays there are almost no 14" CRT screens with only 640 x 480 resolution
around, so the recommended target screen should be a 15" CRT with 800 x
600 or a 17" CRT / 15" TFT with 1024 x 768 resolution.
Of course if you use a proportional table (width is defined in % instead of
pixels, for example, width="95%") it will adapt to the window width,
but in this way it is impossible to define the text flow and formatting: text
and objects tend to "float around" when you change the size of the
browser window. Besides, when the window is very large (or very small) text
readability might be compromised. You can view an example of proportional layout
here: http://www.digitalnaturalsound.com/logic_dsp/
Page Layouts using Frames
As it can be very time consuming to create each HTML page separately, there
are some ways to change just the parts that are different across documents (usually
page title and main page content), and to reuse the same files (HTML and pictures)
for those parts that remain the same (usually website logo and header, navigation
menus, footer).
There are several ways to achieve this, for example using "Frames",
"Templates" or both techniques at the same time.
HTML-Frames: the page is divided in two or more HTML files, some of
which can be fixed, while other can scroll if the page is larger than the screen.
For example, you could have a "top frame" for the main site logo and
header, and for the main navigation menu, then a "left frame" on the
left side for a sub menu, a "main frame" in the middle for the main
content, and a small frame on the bottom for the footer (copyright notice, etc.).
The file "containing" all HTML frames is called a Frameset.
Both frameset and HTML frames must be saved separately (in Dreamweaver: menu
"Datei > Frameset speichern/speichern unter..." or "Datei
> Frame speichern/speichern unter..."
Another advantage of using frames is that the site logo, header and important
navigation elements are always visible also when scrolling down the main frame
and that the amount of code to load for each sub-page is smaller (pages load
faster).
One disadvantage is that the fixed frames use precious screen space and the
main content can never fill up the whole screen. Also if one frame is linked
directly from another site, it might show up without the frameset and without
navigation links ("dead end"). It is possible to use Java-Script commands
to instruct a Frame that has been open outside its Frameset to reload automatically
the main Frameset.
Links across frames: you will have to use the parameter target.
The name of the available frames will be displayed in the Properties drop down
menu. If you use target="_parent" you
can open a new frameset in place of the current one. See HTML
links for details on the target parameter.
Exercise 7.3: Dreamweaver - create a simple frameset with 3 frames
- In Explorer/Finder create a new project folder called "Framesets
and Templates" (under your "/Web Design/"
folder)
- add a "/web/" subfolder (Local Root
Folder), a "/web/img/" subfolder for
pictures and a "/web/frames/" for the
frames.
- in Dreamweaver define a new project called "Framesets and Templates"
and define as Local Root Folder ".../Web Design/Framesets
and Templates/web/"
- create a new empty frameset with one top frame and one side frame on the
left (Strg+N, "Allgemein > Framesets > Oben fest, links verschachtelt")
- go in the page properties [Strg+J] and define a title for the frameset (for
example "Xenomorph's Website")
- select the page border with the mouse pointer and save the frameset [Strg+Shift+S]
as "index.htm" in your root project
folder (directly under /web/);
note: if you do not select the outer border of the frameset you will be saving
one of the single frames instead!
- save the single frames (also here, you have to select them with the mouse
pointer first - just click inside a frame) inside /web/frames/
as:
- index_top.htm (this is the "topFrame",
or header)
- index_left.htm (this is the "leftFrame",
or nav. manu)
- index_main.htm (this is the "mainFrame",
or main page)
- now both frameset and frames are saved separately
- select each frame separately, go to the page properties [Strg+J] and set
the borders to "0" ("Randbreite"
and "Randhöhe")
- you can change the size of the frames by pulling the lines between them:
for example you should stretch the linkFrame to be 160
pixel wide (you can read and also set the width numerically in the properties
box, value "Spalte") so that you can later fit a table with the
navigation menu.
- for now you can leave the topFrame and mainFrame unchanged.
The strcuture of this frameset should be like:
topFrame, 80 pixel high (logo, header)
|
leftFrame,
160 pixel wide
(nav. menu) |
mainFrame
(main page content)
|
Exercise 7.4: Dreamweaver - adding text, pictures etc. to the single
frames
- using the output of Exercise 7.3, add information in the topFrame, leftFrame
and mainFrame; in detail:
- create a logo in Fireworks (about 700 x 80 pixels) adding your name or nickname
as website title (for example "Xenomorph's Website")
- export the logo into /web/img/ as GIF or JPG
file
- in Dreamweaver add the logo you created inside the topFrame (select the
top frame, then [Strg+Alt+I] or menu "Einfügen > Bild")
- add to the leftFrame a small table (menu "Einfügen > Tabelle"
- [Strg+Alt+T] ) about 150 pixel wide, 1 column
and 5 rows, with borders "0" pixel
- add to this table a simple text navigation menu (for example with "Home",
"Über mich", "Projekte",
"Downloads", "Galerie",
"Kontakt" (do not add the hyperlinks
yet, just the text entries)
- add to the mainFrame a table about 550 pixel
wide, 1 column and 4 rows to the mainFrame
- insert in this table the page title (for example"Home") in the
1st row (can be also created in Fireworks as graphic file), then a separator
in the 2nd row (menu "Einfügen > Horizontale Linie", or
create a separator in Fireworks), the main text and pictures in the 3rd row
(for example "welcome to ..." and a personal portrait) and finally
a separator again for the 4th row
- do not forget: save each single frame after every change!
Exercise 7.5: Dreamweaver - add the contact page and a link in the leftFrame
controlling the mainFrame
- using the output of Exercise 7.5, select the mainFrame (currently filename
"index_main.htm") and save it as "contact_main.htm"
inside the "/web/frames/" folder
- change the page title from "Home" to "Kontakt"
- in the main area of the mainFrame, replace the welcome message and picture
(or whatever you placed there) with your contact information (address, tel.
and fax, email)
- save the page again [Strg+S]
- in the leftFrame, select the text "Kontakt", open the hyperlink
dialog (yellow folder symbol from the properties box) and select the "contact_main.htm"
file inside the "/web/frames/" folder
- change the "target" parameter ("Ziel") to "mainFrame"
- save the leftFrame (select, then [Strg+S] )
- open the frameset in the browser (F12) and check that the link is working
properly
- note: the links will only work locally if you choosed a relative path
("relativ zu Dokument") link! Read more on Lesson
1 "Hyperlink Types"
Exercise 7.6: Dreamweaver - add the missing pages
- following the procedure in Exercise 7.5, save "contact_main.htm"
again as "projects_main.htm" (the "Projekte"
page), "aboutme_main.htm" (the "Über
mich" page) and "links_main.htm"
(the "Links" page) - all into inside the "/web/frames/"
folder
- in the leftFrame, add the links to the files above as well as to "index_main.htm"
(the "Home" page)
- remeber to set for each link the "targe" parameter ("Ziel")
to "mainFrame"
- save the leftFrame again [Strg+S]
- open the frameset in the browser (F12) and check that all links are working
properly
- now you can add text and images to the additional pages; remember to change
their titles to "Projekte", "Über mich" and "Links"
- save all files when you are done and check the page again the the browser
(F12).
Lesson 1 | Lesson
2 | Lesson 3 | Lesson
4 | Lesson 5
© 2003-2004 Michele Gaggia - all rights reserved