Chapter 17 CS4

From Digital Foundations

Download Materials for Chapter 17

Click here to download chapter 17 work files.

Chapter 17: Form and Content on the Web

In the last two chapters we left many aesthetic choices out of the exercises and focused on the tools for building code. Aesthetics (how the page looks) is achievable through code, and must not be left out of the conversation. As American architect Louis Sullivan has said, "form follows function". In this chapter we will focus on a key concept in web design: keeping the structural markup separate from the code that controls the aesthetics. In other words, content is contained separately from the style applied to it. There are a few reasons for keeping the two separated, namely: 1. code is displayed on different browsers, each with different styling information; 2. for the purpose of accessibility there are web standards that rely on this separation; and 3. simply for efficiency as styles are easily reused or modified. The separation between content and form is realized when an HTML page full of content is connected to a cascading style sheet (CSS) that applies the aesthetics by treating the page stylistically. A List Apart Magazine explores the design, development, and meaning of web content, with a special focus on web standards and best practices" ([1]]). This website is an excellent resource for developing web designers and information architects. In addition to the wealth of articles, the site itself is a well-crafted engine fronted with easy to navigate typography. Notice the contrast in typographic hierarchies from the search area to the body content of the page, in the headers and links.

Fig17 a-list-apart.jpg

Craigslist.com is a popular website that facilitates an exchange of information between people looking for buyers/sellers/traders and every other possible relationship to commodity, personals, or idea exchange. When asked to think about design, it may not be the first website that comes to your mind. However, as a work of information design, the type is easy to read and even easier to navigate. The hierarchy among the various types of exchanges and locations world-wide is intuitive.

Fig17 craigslist.jpg

So far we have modified page properties and placed links and images on the HTML page using Dreamweaver. The default font, font size, text color, and background color are all styles that can be modified, as well as the appearance of links such as color, underline, and rollover settings. Certain aesthetic options are limited on the web. For instance, in order for a web page to load a specific font, the font must be installed on the user's computer. If the font is missing the browser will load a different font. Therefore, most web pages are designed using "system" fonts (those installed on the computer at the time of purchase), including Helvetica, Arial, Times, Georgia, Verdana, Courier and Geneva. In this chapter we will begin to separate the content of the page from its formal properties using cascading style sheets (CSS).

Exercise 1: Apply a style

So far we have modified the HTML page properties and placed links and images on the web page using Dreamweaver. Template:Infobox Until now, these page elements have all followed the default settings for font, font size, text color, and so on. By using CSS, we can control these and other design settings. We will separate the content of the page from its style properties, which will be stored in the CSS file.
Note: Remember, certain aesthetic options are limited on the web. For instance, in order for a web page to load a specific font, the font must be installed on the user's computer. If the font is missing, the browser will load a different font. Therefore, most web pages are designed using "system" fonts (those installed on the computer at the time of purchase), including Helvetica, Arial, Times, Georgia, Verdana, Courier, and Geneva.

1. Open Dreamweaver and choose HTML from the Create New area of the Welcome Screen.

Fig17-1-newdoc.jpg
Template:Infobox

2. Before adding content to the HTML file, choose File > Save As and save the file as index.html into a folder you will use for this chapter. We saved our file in a folder on the Desktop called chapter17.

3. Evaluate the code of the HTML file. You can do this in Code view or you can open the saved HTML file in a web browser and use the View menu to see the source code. So far the code only contains HTML.

Fig17-2-source-crop.jpg

4. Open the Page Properties dialog box by choosing Modify > Page Properties and change the default font. We used the Page font pull-down menu to choose the default font: Verdana, Geneva, sans-serif. Click OK after choosing a font.

Fig17-3-pageprop.jpg

5. Dreamweaver saves the default HTML page settings as a style. Choose File > Save. Look in Code view or reload the page in the browser so you can see the changes. We will evaluate this code in the next exercise.

Fig17-4-stylesinsource-crop.jpg

Exercise 2: Evaluate the code

Exercise 3: Create a new rule

Fig17-5-modifystyle-crop.jpg

Fig17-6-newrule-crop.jpg

Fig17-7-newrule2.jpg

Fig17-8-ruledefin.jpg

Fig17-9-applystyle.jpg

Fig17-10-viewallstyles.jpg

Fig17-11-headlinestyle.jpg

Fig17-12-span.jpg

Exercise 4: Create an external style sheet

Fig17-13-highlightdef.jpg

File:Fig17-14-highlight.jpg

Fig17-15-link1-crop.jpg

Fig17-16-link2.jpg

Fig17-17-link3.jpg

Fig17-18-applyhighlight.jpg

Fig17-19-seecode.jpg

Fig17-20-browserlinked.jpg

Fig17-21-browserunlinked2.jpg