Project 12--Style Sheets and Templates


Make any corrections that were listed in the previous grade report.


Adding styles to a website

You may have noticed that the pages you completed so far for your "website" have been pretty plain. It is possible to use HTML tags and properties to format within your web pages, but in today's web design world  the recommendation is to create the elements and text for your pages and THEN do the formatting. It is also suggested that you keep the HTML coding for adding the content to the page separate from the commands you use to add formatting. To accomplish this, you can create a stylesheet that has your formatting rules and then attach the stylesheet rules to your existing HTML pages by using the <link> tag. If you have a multiple-page website that you would like to have consistent formatting for, an external style sheet is the best thing to use.

Read the Lecture Notes for CSS.

Visit the w3schools website to familiarize yourself with the concept of using cascading style sheets to add formatting to a website. Go to the Home page for W3Schools, visit the Learn CSS section and use the links to visit the different pages about CSS basics. Note that on some pages, you only need to read certain sections. You are only learning the elementary BASICS for creating CSS in this project.

http://www.w3schools.com/

Another website that may be helpful in understanding CSS:
http://spot.colorado.edu/~baileysm/tutorials/css_beginner.html
We will be using "method two" described on this page for this project.


Self-Check Questions

Based on the information at the W3Schools website, answer the following questions:

  1. What does the acronym CSS stand for?
  2. What are the three parts of CSS syntax?
  3. In CSS syntax, what is a selector?
  4. In CSS syntax, what is a property?
  5. What mark of punctuation is used between the property and the value given for the property in a style rule?
    Pick one: the colon ( : ) or the semicolon ( ; )
  6. What is used to surround the properties and values given in a style rule?
    Pick one: < > or { }
  7. If a style rule has more than one property-value listed, what mark of punctuation is used to separate the property-value pairs?
    Pick one: the hyphen ( - ) or the semicolon ( ; )
  8. When should quotes be used in property values?

    Using the sample style rule, answer the following questions:
    Sample:
    body {margin-left: 20%}
  9. What is the selector?
  10. What is the property?
  11. What is the value?

    Sample:
    body
    {margin-left: 20%
    margin-right: 20%}
  12. What mark of punctuation is missing in the above style rule and where should it be placed?

    Sample:
    h1 {font-family: "Comic Sans MS",sans-serif}
  13. What is the selector?
  14. What is the property?
  15. What is the value?
  16. Create a style rule for the horizontal rule HTML element <hr>. Set the value for the size property to 6px.
  17. Create a style rule for a level 1 heading. Set the value of the color property to #FF0000.
  18. Create a style rule for the paragraph. Set the value of the line-height property to 1.5em. Set the value of the text-indent property to 2em.

    Complete the following sentences.
  19. A style sheet should be saved with a _______________ extension.
  20. Each web page must link to the style sheet by using the _________tag.
  21. The tag to link a style sheet to a web page goes inside the ___________section of the code.
  22. When you give a unit of measurement for a value in a style rule, why is it important to NOT leave a space between the value and the unit of measurement? (Answer is on the CSS How To....page at w3schools.com)

    When using units of measurement for a value in a style rule, what do the following abbreviations represent?
  23. 2em
  24. 7px
  25. 20pt

Practice Exercise

Visit the following online resource:
http://www.tizag.com/cssT/external.php

Follow the instructions on the web page to create an html page named index.html and a stylesheet named test.css


Lab Activity

When creating a stylesheet for a website, you look at the HTML elements that you have in your pages and then create style rules for the properties of each element. You have used the following elements that can be formatted in your web pages: body, paragraphs, headings, horizontal rules, images and links. To create a stylesheet to format a few of these elements, follow these steps:

body
{margin-left: 20%;
margin-right: 20%;
margin-top: 2em;
margin-bottom: 2em}

h3
{font-family: "Comic Sans MS", sans-serif;
font-size: 115%;
color: #xxxxxx}

p
{font-family: Arial, sans-serif;
font-size: 110%}


Quick and Easy Web Design at GeoCities!!

Read through all of the directions here before you start, to familiarize yourself with the process of using a template. Depending on choices you make, the order of the directions may be different. 

I have listed the steps below only to give you a general idea of what to expect, but there may be additional steps and a few choices that are not listed here. Read the directions given on the pages you visit to help you through the steps.  If you work carefully through the directions and get it right the first time through....this activity will not take you very long!!  There are times, however, when Yahoo is being sluggish, so do not put off completing this project until the last minute.  Not being able to access Yahoo, or Yahoo running slowly is not a valid excuse for not completing the project on time.

Print these directions so when you work through the instructions in the wizard, you will have the details that I am asking for handy to look at.  Work  slowly and carefully paying close attention to detail.  

Please do not add more to the page beyond what is included in the directions or use other html tools at Geocities for this project.   

Things like animation and large graphics slow down the loading of the page and I have to view many of them!!   The primary purpose of this project is to take advantage of the template offered by Geocities, not to control the layout of the page or add fancy features.  Let the wizard do the work for you!!  Just follow the directions given and allow plenty of time.  

Ready, Set, Build!!
(Sometimes, Geocities will change the order of the steps to build a page slightly.  Read the directions and if they are somewhat different, see if you can guess the correct choices to continue through the process!)


In STEP #1:  Enter your page title and text

Make your page title: Learning the Internet

For your text:  Compose several paragraphs of text. In the first paragraph, tell how often you use the Internet and what you use it for.  In the second paragraph, assume that someone you know has enrolled in this course for next semester. What advice would you give this student to help them successfully complete this course? In the third paragraph tell approximately how much time you spent each week on this course and tell about anything that made it difficult to get projects done on time (work hours, illness, self-discipline, lack of computer equipment at home...) In the fourth paragraph, tell about anything that helped you complete projects (fast Internet connection, text, project instructions, lecture notes, email from instructor, meeting with instructor, friends with Internet experience...) In the last paragraph tell what courses you plan to take next semester. Use complete sentences, proper grammar and spelling. You will lose points for typos!


In STEP #2:  Pick your picture

Choose the option for "Use your own image"
Use "Upload new image" button to upload the clip art that you have saved.

Having a caption is optional. If you have used an image from a clip art gallery that requests you give them credit, this is a good place to mention where the image is from.


In STEP #3:  Enter your favorite links

Replace the text that says:  “My favorite links” with: Learning HTML

Replace the Yahoo link names and web addresses that are given with the following link names and web addresses. The link name will be visible on the page.  The URL will be hidden.  Type these URLs very carefully...or use copy and paste.

Link name Web Address
Parkland College http://www.parkland.edu
W3Schools http://www.w3schools.com
XHTML Tutorial

http://spot.colorado.edu/~baileysm/tutorials/xhtml.html

Project 12 styled page

http://www.geocities.com/yourlogin/movies-xx.html

(In the above link, change "yourlogin" to your login at Geocities and change the xx to your initials so that this link will really go to your movies web page at Geocities.)


In STEP #4:  Enter your information

Enter your info. You can replace the existing text “My Info” with text of your own choosing or leave the text as it is for your heading of this section of your page. 

In the Naming your page screen:


Short answer questions:

Use the following code to name the parts of a CSS style rule:
body {margin: 1em}

  1. In the above style rule, what is the selector?
  2. What is the property?
  3. What is the value?
  4. What is the property:value pair?
  5. Write a style rule for the level 2 heading. Set the text-align property to right.
  6. Approximately how long did it take to complete all the readings and activities for this project?
  7. How would you rate the difficulty of this project compared to the other web page projects?

Send email to the instructor:

Each URL should be on a new line by itself. Send a copy of the email that you send me to yourself so that you can check your URLs as they will appear in email.  If you do not send them to me correctly, I will not be able to view your pages.  You will lose substantial points if I have to ask you to revise your URLs and resend....

The best way to be sure that you are sending an accurate URL is to view your page in the browser after you have uploaded it to Geocities. With the page viewing in the browser, click in the address bar of the browser where the URL of the page is being displayed. Right-click on the URL, choose COPY from the pop-up menu. Open your student email and right-click in the email window of the message you plan to send to me. Right-click and paste the URL into the email message area.


Note:

Your .css page is a plain text page of code. It will not view in the browser as a web page. If you try to view your styles.css page in the browser, it will (most likely) automatically open into a FrontPage window. If you want to view your css stylesheet without using FrontPage, you will need to open it in Notepad.


Hosted by www.Geocities.ws

1