0% found this document useful (0 votes)
2 views

Lesson 3 Notes

This document outlines HTML practice exercises aimed at enhancing web design skills, focusing on audience-targeted design, website organization, and effective content presentation. It covers various types of website organization (hierarchical, linear, random), formatting tips for readability, and the use of Cascading Style Sheets (CSS) for styling web pages. Additionally, it discusses CSS advantages, syntax, and methods for applying styles, including inline, embedded, and external styles.

Uploaded by

cameron.king1202
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Lesson 3 Notes

This document outlines HTML practice exercises aimed at enhancing web design skills, focusing on audience-targeted design, website organization, and effective content presentation. It covers various types of website organization (hierarchical, linear, random), formatting tips for readability, and the use of Cascading Style Sheets (CSS) for styling web pages. Additionally, it discusses CSS advantages, syntax, and methods for applying styles, including inline, embedded, and external styles.

Uploaded by

cameron.king1202
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

HTML Practice Exercise #3

In this and subsequent lessons you will be expanding your knowledge of HTML codes through a series of HTML practice
exercises. These exercises, used in conjunction with the assignments, will culminate in a complete web site.

In this exercise, I provide suggestions for proper presentation and navigation. You should apply what you learn to the
final web project (Assignment #6).

Web Design

Design for your Target Audience

Whatever your personal preferences, design your website to appeal to your target audience—the people who will use
your site. Your intended target audience may be specific, such as children, teenagers, college students, young couples,
or seniors, or you may intend your site to appeal to everyone. The purpose and goals of your visitors will vary—they may
be casually seeking information, performing research for school or work, comparison shopping, job hunting, and so on.
The design of a website should appeal to and meet the needs of the target audience.

Website Organization

One of the most important parts of creating a Web site is deciding how the user is going to find the information you are
presenting. There are three common types of website organization:
Hierarchical
Linear
Random

Most websites use hierarchical organization. A site map for hierarchical organization is characterized by a clearly defined
home page with links to major site sections. Web pages within sections are placed as needed. The home page and the
first level of pages in a hierarchical site map typically indicate the hyperlinks on the main navigation bar of each web
page.

When the purpose of a site or series of pages on a site is to provide a tutorial, tour, or presentation that needs to be
viewed sequentially, linear organization, ​is useful. In linear organization, the pages are viewed one after another. Some
websites use hierarchical organization in general, but with linear organization in a few small areas.

Random organization (sometimes called Web organization) offers no clear path through the site. ​There is often no clear
home page and no discernable structure. Random organization is not as common as hierarchical or linear organization
and is usually found only on artistic sites or sites that strive to be especially different and original. This type of
organization is typically not used for commercial websites.

One good way to plan the layout of your pages is to draw a "map" of your pages - just a bunch of circles representing
each page, and lines between them representing the links you have made between them.

Here are a few example layouts and suggestions of what they may be appropriate for. (Please note that I cannot cover
every possibility, and what is listed here as appropriate is not the only way of doing it.)

Figure 1.

This kind of layout would be best suited to an essay, or a technical paper, which needed to have an extensive glossary or
set of footnotes. Links from the index to the sub-pages allow the reader to pick sections, links between sections allow
them to read them all in order, and links to the "footnote" page provide explanations when needed.

Figure 2.

This type of layout is rarely used but is sometimes appropriate. If your site contains a large number of unrelated topics,
they would be together linked at the main index, but not between each other.

Figure 3.

This is one of the more common types of layout, with one main index linking to sub-topics, which could then link to more
sub-topics, and so on. An example of a major site which uses this layout would be the Yahoo! Web Indexing site.

Figure 4.

Though it may not look it, this layout is the same as the one above it. Remember that just because one menu is three
levels deep, they do not all have to be.
Presentation

Formatting your Content

When arranging text for a presentation, whether it is on a Web page, in an essay, or in an annual business report, great
care must be taken to present the information in a manner which does the following:

1. Holds the interest of the reader


2. Is easy to read
3. Flows smoothly

These may be achieved by using the following screen design tips:

Fonts

The best sans serif fonts to use for maximum ease in screen viewing of type are 11-pixel Verdana, Arial, and Helvetica, in
that order. These are all SANS-serif fonts (Macworld, "Reconcilable Differences: Design Web Sites that Work Anywhere."
p. 70, September 2000).

Emphasis

Avoid using italics, underline and caps for long passages.

Line Lengths

Aim for about 10-12 words, or 40-60 characters, per line.

Justification

Use left justification to avoid unpredictable spacing between words.

Colour

For large amounts of text, try black text on white or very pastel backgrounds. Pastel colour backgrounds are preferable to
white, which tends to glare.

Use blue for large areas, because our eyes aren't particularly sensitive to it.

Avoid placing two colours side by side if they differ only the amount of blue they contain. The boundaries will appear
blurry because of the eye's lack of blue receptors.

Avoid using red and green for large areas - it is distracting. Also, many people are red/green colour blind, and wouldn't be
able to see what you are trying to emphasize with these colours.

To de-emphasize objects, colour them close to the background.

Match people's colour expectations (red - stop, yellow - caution/creative, green - go/nature, blue - water/cold, grey -
neutral).

Remember, colour schemes can contribute greatly, not only to the interest of the pages, but also to their readability. Be
careful not to overdo it.

Shapes and Colour

Use the same colour for grouping related elements.

Graphics

Langevin Learning Services advises one to place graphics in the top half of the screen and text in the bottom half (or
place graphics on the right-hand side of the screen if there is no text). This is because the reader's eyes start in the
upper-left corner of the screen and proceed right and down (cf. Kristof & Satran, p. 90). Messages in the bottom left-
corner can often be overlooked. (Langevin Learning Services. Designing Computer Based Training. Training manual
distributed by course leader Terry Donahue, during Designing Computer Based Training workshop, Delta Chelsea Inn,
Toronto, Ontario, September 6-9, 1995).

Readability

For your writing style, the same basic rules should be applied as when you are writing anything else. Good grammar and
spelling are important, as well as keeping the information relevant. If there is no point to a statement, it should not be
included in your page.

The last part of formatting is how the text itself is arranged. Remember that when people are first taught how to read (in
English), it is with the text flowing from left to right, and all of it is aligned smoothly with the left-hand margin. Since
native English speakers are all introduced to the language in this manner, it is always easier to read it that way as well.
Cascading Style Sheets (CSS)

Overview of Cascading Style Sheets (CSS)


· See what is possible with CSS:

o Visit http://www.csszengarden.com

· Style Sheets

o used for years in Desktop Publishing

o apply typographical styles and spacing to printed media

· CSS

o provides the functionality of style sheets (and much more) for web developers

o a flexible, cross-platform, standards-based language developed by the W3C.

CSS Advantages
· Greater typography and page layout control
· Style is separate from structure
· Styles can be stored in a separate document and linked to from the web page
· Potentially smaller documents
· Easier site maintenance

Types of Cascading Style Sheets

· Inline Styles

o Configured in the body of the Web page

o Use the style attribute of an XHTML tag

o Apply only to the specific element

· Embedded Styles

o Configured in the header section of a Web page

o Use the HTML <style> element

o Apply to the entire Web page document

· External Styles

o Configured in a separate text file with .css file extension

o The HTML <link /> element in the header section of a Web page associates it with the .css file

· Imported Styles

o Similar to External Styles

o We’ll concentrate on the other three types of styles

CSS Syntax
· Style sheets are composed of "Rules" that describe the styling to be applied.
Each Rule contains a Selector and a Declaration

CSS Syntax Sample

Configure a Web page to display blue text and yellow background.


body { color: blue;
background-color: yellow; }

This could also be written using hexadecimal color values as shown below.

body { color: #0000FF;


background-color: #FFFF00; }

Common Formatting CSS Properties


· background-color
· color
· font-family
· font-size
· font-style
· font-weight
· line-height
· margin
· text-align
· text-decoration
· width

Using Color on Web Pages


· Computer monitors display color as intensities of red, green, and blue light
· RGB Color
· The values of red, green, and blue vary from 0 to 255.
· Hexadecimal numbers (base 16) represent these color values.

Hexadecimal Color Values


· # is used to indicate a hexadecimal value
· Hex value pairs range from 00 to FF
· Three hex value pairs describe an RGB color

Web Color Palette


· A collection of 216 colors
Display the most similar on the Mac and PC platforms
· Hex values:
00, 33, 66, 99, CC, FF
· Color Chart
http://webdevfoundations.net/color

Making Color Choices


· How to choose a color scheme?

o Monochromatic

§ http://meyerweb.com/eric/tools/color-blend

· Choose from a photograph or other image

o http://www.colr.org

· Begin with a favorite colour

o Use one of the sites below to choose other colours


§ http://colorsontheweb.com/colorwizard.asp
§ http://kuler.Adobe.com
§ http://colorschemedesigner.com/

Accessibility & Color


· Everyone is not able to see or distinguish between colors
· Information must be conveyed even if color cannot be viewed
· According to Vischeck http://www.vischeck.com/vischeck

o 1 out of 20 people experience some type of color deficiency

o Color choice can be crucial

o Avoid using red, green, brown, gray, or purple next to each other

o White, black, and shades of blue and yellow are easier to differentiate.

· Simulation: http://www.vischeck.com/vischeck/vischeckURL.php

Configuring Color with Inline CSS (1)


· Inline CSS

o Configured in the body of the Web page

o Use the style attribute of an XHTML tag

o Apply only to the specific element

· The Style Attribute

o Value: one or more style declaration property and value pairs

Example: configure red color text in an <h1> element:


<h1 style="color:#ff0000">Heading text is red</h1>

Configuring Color with Inline CSS (2)


Example 2: configure the red text in the heading
configure a gray background in the heading

Separate style rule declarations with ;

<h1 style="color:#FF0000;background-color:#cccccc">This is displayed as a red heading with gray


background</h1>

CSS Embedded Styles


· Configured in the header section of a Web page.
· Use the XHTML <style> element
· Apply to the entire Web page document
· Style declarations are contained between the opening and closing <style> tags
· The type attribute indicates the MIME type of text/css

Example: Configure a Web page with white text on a black background

<style type = “text/css”>


body { background-color: #000000;
Color: #FFFFFF;
}
</style>

CSS Embedded Styles


· The body selector sets the global style rules for the entire page.
· These global rules are overridden for <h1> and <h2> elements by the h1 and h2 style rules.
<style type="text/css">
body { background-color: #E6E6FA;
color: #191970;}
h1 { background-color: #191970;
color: #E6E6FA;}
h2 { background-color: #AEAED4;
color: #191970;}
</style>

Configuring Text with CSS


· CSS properties for configuring text:

o font-weight

§ Configures the boldness of text

o font-style

§ Configures text to an italic style

o font-size

§ Configures the size of the text

o font-family

§ Configures the font typeface of the text

The font-size Property

· Accessibility Recommendation:

o Use em or percentage font sizes – these can be easily enlarged in all browsers by users

The font-family Property

· Not everyone has the same fonts installed in their computer


· Configure a list of fonts and include a generic family name

p {font-family: Arial,Verdana, sans-serif;}

Embedded Styles Example

<style type="text/css">
body { background-color: #E6E6FA;
color: #191970;
font-family: Arial, Verdana, sans-serif; }
h1 { background-color: #191970;
color: #E6E6FA;
line-height: 200%;
font-family: Georgia, "Times New Roman", serif; }
h2 { background-color: #AEAED4;
color: #191970;
font-family: Georgia, "Times New Roman", serif; }
p {font-size: .90em; }
ul {font-weight: bold; }
</style>

External Style Sheets - 1


· CSS style rules are contained in a text file separate from the XHTML documents.
· The External Style Sheet text file:
o extension ".css"

o contains only style rules

o does not contain any XHTML tags

External Style Sheets - 2


· Multiple web pages can associate with the same external style sheet file.

site.css

body {background-color:#E6E6FA;
color:#000000;
font-family:Arial, sans-serif;
font-size:90%; }
h2 { color: #003366; }
.nav { font-size: 16px;
font-weight: bold;
}

The <link /> Element


· A self-contained tag
· Placed in the header section
· Purpose: associates the external style sheet file with the web page.
· Example:
<link rel=”stylesheet” href=”color.css” type=”text/css” />

Using an External Style Sheet

Example: External Style Sheet colour.css


body {background-color:#0000FF; color:#FFFFFF;}

To link to the external style sheet called color.css, the HTML code placed in the header section is:
<link rel="stylesheet" href="colour.css" type="text/css" />

Centering Page Content with CSS

#container { margin-left: auto; margin-right: auto; width:80%; }

CSS Selectors

CSS style rules can be configured for an:


· HTML element selector
· class selector
· id selector

Using CSS with “class”


· class Selector

o apply a CSS rule to a certain "class" of elements on a Web page

o does not associate the style to a particular HTML element

· Configure with .classname


· The sample creates a class called “new” with red italic text.
<style type=”text/css>
.new { color:#FF0000; font-style: italic; }
</style>
· To use the class, code the following HTML:
<p class=“new”>This is text is red and in italics</p>

Using CSS with “id”


· id Selector

o Apply a CSS rule to ONE element on a Web page


· Configure with #idname
· The sample creates an id called “new” with red, large, italic text.
<style type=”text/css”>
#new { color:#FF0000; font-size:2em; font-style: italic; }
</style>
· To use the id, code the following XHTML:
<p id=“new”>This is text is red, large, and in italics</p>

HTML <div> element


· A block-level element
· Purpose: configure a specially formatted division or area of a Web page

o There is a line break before and after the division.

o Can contain other block-level and inline elements

· Useful to define an area that will contain other block-level tags (such as paragraphs or spans) within it.

HTML <div> Element Example


· Configure a page footer area
· Embedded CSS:

<style type="text/css">
.footer { font-size: small;
text-align: center; }
</style>

· HTML:
<div class=“footer">Copyright &copy; 2009</div>

XHTML <span> element


· An inline-level element
· Purpose:
o configure a specially formatted area displayed in-line with other elements, such as within a paragraph.
· There is no line break before and after the span.

HTML <span> Element Example


· Embedded CSS:
<style type="text/css">
.companyname { font-weight: bold; font-family: Georgia, "Times New Roman", serif; font-size:
1.25em;}
</style>

· XHTML:
<p>Your needs are important to us at <span class=“companyname">Acme Web Design</span>.
We will work with you to build your Web site.</p>

W3C CSS Validation


· http://jigsaw.w3.org/css-validator/

CSS Guidelines – Getting Started


· Review the design of the page

o Configure global font and color properties for the body selector

o Identify typical elements (such as <h1>, <h3>, and so on) and declare style rules for these if needed.
Identify page areas such as logo, navigation, footer, and so on – configure an appropriate class or id for each.
Create one prototype page that contains most of the elements you plan to use and test.
Revise your CSS as needed.
Once your design is set – move styles to an external .css file
Planning and testing are important activities when designing a Web site

CSS Troubleshooting Tips


· Verify you are using the : and ; symbols in the right spots—they are easy to confuse.
· Check that you are not using = signs instead of : between each property and its value.
· Verify that the { and } symbols are properly placed
· Check the syntax of your selectors, their properties, and property values for correct usage.
· If part of your CSS works, and part doesn’t:

o Review your CSS

o Determine the first rule that is not applied.


Often the error is in the rule above the rule that is not applied.

· Validate your CSS at http://jigsaw.w3.org/css-validator

Next Step

If you can meet the objectives stated at the beginning of Lesson 3, you are ready to proceed to the next lesson. Keep in
mind the weekly schedule recommended in the course syllabus. Please post to the Discussion area of this course web
site any questions or comments related to this lesson. Only emergency and private messages should be sent through
email to the instructor.

Assignment

Assignment #2 is due this week.

Please visit the Assignments portion of the course for details on Assignment #3.

You might also like