Cascading Style Sheets (CSS)

Lab 7

More JavaScript

  1. Copy hello.html from LAB6 to a new LAB7 directory.
  2. Add a second attribute assignment to the opening tag of the p element in the body of your new hello.html page:
           o n c l i c k = i n i t ( ) ;
  3. Remove the first line of the script element:
    w i n d o w . o n l o a d = i n i t ;
  4. Save your file and open it in some browser. Click on the Hello World text. Type your name in the popup window. Then hit Enter.
  5. Now click on your name and enter someone else's name.

Decorating the HeadFirst Lounge

  1. In your LAB7 directory, download and extract lounge.zip.
  2. Edit the lounge.html file in the lounge directory.
  3. Create a <style> element inside its <head> element.
  4. Modify color, font-family, and border bottom of <h1>, <h2>, and <p> elements as indicated in the text.
  5. Move your CSS rules to a lounge.css file in your Chapter7 directory.
  6. Using the <link> element, attach your lounge.css CSS rules to your lounge.html page.
  7. Link the elixir.html and directions.html pages to the same lounge.css file. (Get the relative path right as the value for the <link>'s href attribute.)
  8. Use property inheritance to change the default font-style to sans-serif by creating a rule for the <body> element.
  9. Use the class attribute (as indicated in the text) to change the colors of the text in the paragraphs of the elixir.html page.
  10. Use the validator, http://jigsaw.w3.org/css-validator, to check that your pages meets W3C standards.
  11. Edit the index.html file in your LABS directory to hyper-link to the revised hello.html and lounge.html pages in your LAB7 directory.

Begin to style your About Me site

  1. Create an project.css file in your PROJECT directory.
  2. Use inheritance to make the default font-style be some sans-serif font family.
  3. Attach this CSS file to your index.html page and your other project pages.
  4. Check that the CSS is valid.

Synchronize your website to your thumbdrive

Always turn off your computer and screen before leaving the room.