Friday, October 19, 2007

We reviewed the CSS box model. I introduced the notion of the id attribute and how id's differ from classes. (Do you remember talking about the id attribute of an HTML element before today? Look back at pp. 152ff.) In a CSS rule selector, a class is identified by a period—e.g., .blueberry—while an id is identified by a pound sign—e.g., #navmenu.

I handed out an HTML cheat sheet and a CSS cheat sheet. Use these to trigger your memory about various things. Keep in mind that more details are available at DevGuru and other sites.

A couple of things to remember from last time:

  • The unit em is the height of an M in the current font.
  • If the levels of red, green, and blue in a color are the same, then the color is a shade of gray. #333333 (or #333) is a darker shade of gray and #aaaaaa (or #aaa) is a lighter shade.
  • White is full intensity of all three colors (#ffffff) and black is the lack of all colors (#000000).

There will be a quiz next Wednesday. It will cover what we do through Monday's class.

Lab

I am starting a mail-order business called Dave's Daylilies. I know using a Web site to sell my products will be much cheaper than using printed catalogs. I sell daylilies, iris, and bird feeders.

Design a Web site for me. I know that eventually I will need to have the site use server-side scripting, but for now I think I can manage with static pages since my inventory is small: 12 kinds of daylilies, 15 kinds of iris, and 4 kinds of feeders.

Here is what I need users of my site to be able to do.

  • Browse by type of product (daylily, iris, or birdfeeder). I should have a photo of each product eventually. I have a few already in a zip archive.
  • Print an order sheet.
  • Contact me via telephone, e-mail, or snail mail.
  • Learn about the care of daylilies and iris. (Fortunately, they are pretty much care-free if they are planted correctly so there's not much to provide other than planting instructions, watering, and dividing.)
  • Learn about the company.

What I'd like from you:

  1. A design for the Web site—that is, the pages you recommend and how they are organized into folders.
  2. A design for the home page, including what the navigation menu should be and what pages it links to.
  3. A suggestion for the presentation. Since I'm just getting started, I could use a logo and a color theme.

For now, just use lorem ipsum to fill out the text parts of the pages that discuss products and product care.

Homework

Read the rest of Chapter 10 and complete the work-along exercise. Be sure your HTML file and your CSS file validate.

When you have finished the exercise, send the files lounge.html and lounge.css as attachments to an e-mail message having the subject Chapter 10 Part B.

Wednesday, October 17, 2007

We discussed accessibility. The general consensus was that we have a corporate social responsibility to make accessible the parts of the Web we develop. (I tried an accessibility check on my home page. One should and one may fix!)

We also worked a bit more with Nvu [download]. I walked you through some of its capabilities and some of its quirks (a need to refresh the site manager and the odd way you need to set up an external style sheet). We developed a skeletal Web site with a home page, an image, and a style sheet. I hope you'll start to use it and explore its capabilities. It makes you more productive than you can be coding tags by hand. However, you will often have to view the source and edit it to create the page you want. I encourage you to use it for the homework due Friday.

I introduced the CSS box model.

On your blog, please comment on (at least) three different Web sites each week. Be sure to check your grammar and spelling. Put a link to the page you are discussing.

Homework

Read pages 385–413. Work along with the book using the files provided. Be sure your HTML file and your CSS file validate.

When you have finished the exercise, send the files lounge.html and lounge.css as attachments to an e-mail message having the subject Chapter 10 Part A.

Monday, October 15, 2007

We talked briefly about answers to the homework assignment for today and then you worked through a lab in pairs.

We also welcomed Austin to our class. He was visiting Wofford today as a prospective student.

Lab

  1. Find a partner to work with.
  2. Download the file LoremIpsum.html to your computer.
  3. Create an external style sheet that will make the page look like mine. (Why am I linking to an image instead of to an HTML file?)
  4. Before the end of class, send me the CSS file via e-mail. Be sure to let me know the names of both partners.

The colors I used are among the standard 17 CSS colors.

Feel free to ask me questions or to as questions of other pairs around you.

Homework

For Wednesday, read the handout Introduction to Web Accessibility.

Friday, October 12, 2007

We investigated KompoZer after Quiz #3.

Homework

Read Chapter 9 of HFHTML.

Answer the questions below and bring the answers with you to hand in at the start of class on Monday.

  1. For the font-family property, a list of font names can be specified. How does a browser use this list? And why isn't specifying one font sufficient?
  2. What does the line-height property specify?
  3. What is the meaning of the unit em? What is the em equivalent of 150%?
  4. What does font-style: normal; mean?
  5. What color is rgb(0,0,0)? What color is rgb(255,255,255)?
  6. Suppose I want to set my page's background to the color listed as tomato among the X11 color names. Give two values I can list in a rule to get that color.
  7. Determine the decimal values associated with the levels of red, green, and blue for the hex code #daa520.
  8. What do all these colors have in common: #111111, #555555, #888888, #aaaaaa, and #dadada?

Wednesday, October 10, 2007

We reviewed CSS and many of the concepts discussed in Chapter 8. I posed a few questions and we discussed the answers [sheet from class].

I announced a quiz for Friday. I plan for it to be short. It will cover HFHTML chapters 6, 7, and 8. If you understood what we talked about this morning, then you should be in good shape.

We spent some time installing KompoZer on the lab computers because Nvu does not want to run correctly on some of the computers (including mine!). I'll show you how to use KompoZer next time.

I encourage you to start reading Chapter 10. I think you will find it interesting and useful. It focuses primarily on fonts and colors.

Monday, October 8, 2007

We continued to look at style sheets today. The latter part of Chapter 8 introduces some important concepts:

  • external style sheets
  • inheritance [pp. 311-315]
  • fonts (sans-serif and serif) [p. 309]
  • classes [pp. 316-323]
  • CSS validation (jigsaw.w3.org/css-validator)
  • various properties (p. 330)

Homework

Read Chapter 8. This is a key chapter to "get" for understanding how CSS works.

Friday, October 5, 2007

We started cascading style sheets (yay). They are covered in Chapter 8 of HFHTML.

Here is the style element we put into a Web page today. Recall that a selector designates the element type that the rule applies to and that the order rules are listed matters when two rules seem to contradict (as in the two color property settings for <h1> elements in the example.

<style type="text/css">
/*  style rule syntax: 

    selector {  property: value; ... }

*/

p {
    color: teal;
}

h1, h2, h3, h4, h5, h6 {
    color: teal;
}

h1 {
    border: thin black dashed;
    background-color: silver;
    color: black;
}

</style>

Homework

Read pages 285–310 of HFHTML. Add some style to your class home page on cs.wofford.int: sans-serif font of a color you choose (not black) and a background color of your choice (not white). See if you can figure out how to get a border around the whole body that is the same color as the text.