1. week 1
  2. week 2
  3. week 3
  4. week 4
  5. week 5
  6. week 6
  7. week 7
  8. week 8
  9. week 9
  10. week 10
  11. week 11
  12. week 12
  13. week 13

Thursday, June 24, 2010

Summer 2010 week 7:
6/24/10: Wednesdays 6:00 - 9:00

Hi again everyone,
Please do the homework questions below for next week's class. The steps below that are for extra credit.

  1. TOPICS:
    1. Introduce I: Cascading Style Sheets:
      1. LINK   CSS: What?
      2. LINK   CSS: Where?
      3. LINK   CSS: How?
      4. LINK   CSS: Why?
  2. HOMEWORK I: Do the questions below as this week's homework;
  3. EXTRA CREDIT: Do the steps below to create a webpage;
  4. QUESTIONS: Here are some questions to help guide you through this weeks' material—chapters 3, 5, and 7 in the text on CSS:
    1. How many fonts can you specify for the font-family CSS property?
    2. According to the book (chapter 5), what are the four most widely supported fonts on computers?
    3. Of the two codes we have been covering in class up to now, which one is to be used mainly for structuring or organizing the page content and which is to be used mainly for designing or presenting the page content?
    4. What would the purpose of consistent presentation of your individual web pages throughout your site be—for example: designing the text in the paragraphs the same in all the pages, designing the main headings in all the pages the same, making the links in all the pages the same?
    5. What is the difference between an internal and an external style sheet with regard to where they are typed?
    6. What are two ways to link style sheets to a web page?
    7. What is a CSS rule?
    8. What are the two main parts of any CSS rule?
    9. What is a selector in CSS?
    10. Other than tag names, what are two other types of CSS selectors?
    11. What are two differences between IDs and Classes?
    12. What character must be typed before the name of an ID? Before the name of a class?
    13. How do you apply a class or an id so that the styles show up in a page?
    14. Name five (5) examples of CSS properties that we have used in class.
    15. Name three (3) examples of CSS selectors that we have used in class.
    16. What does the <div>≶/div> tag pair do?
    17. How many different types of borders can you create with CSS? What are they?
    18. What is padding?
    19. Name three (3) places in a web page that you can set a background color.
    20. Type an example of the code for setting a background image using CSS. In this code, you must also determine if the image is to be repeated, and where it is to be positioned on the page.

  5. INTRODUCE I:
    1. Cascading Style Sheets (CSS)—in this week’s class we saw the introduction of the issue Cascading Style Sheets used together with HTML in order to style the text and colors of a page. CSS works often in much the same way that the in-line HTML tags (<b>, <i>, <u>, <font>, etc.) do to bring some styling onto an otherwise dull page of text. For this reason and from this point on, CSS will completely supplant those in-line tags for our uses in this class. In-line tags are not considered proper when following strict XHTML guidelines (and as a result will not pass the test when the code is validated); therefore, our job is to determine how to best configure our pages without them. In other words, from this point on, we will no longer be using many of those inline tags, and heretofore use only CSS; thereby, at last adherely completely to XHTML Strict standards.
    2. What is CSS?

      To begin with, CSS is another type of code used only to style a page of content (mostly text and images). It is used for two reasons.

      • First,
        it is vastly more extensive and, thereby, flexible. There are many more aspects of style that you can control with CSS than without it, as you will find out in the weeks to come. You can therefore control the look of your pages much more thoroughly. As a result, you will have many more options of how to style a page, using your own design sense of how to emphasize various elements in the site.

      • Second,
        as it considers a web-site as a living, changing object rather than 100% complete and fully-formed when it is uploaded onto a server, it is much more efficient to use and, therefore, allows you to update your pages much more quickly and completely.

    3. Where is CSS placed?

      depending on what kind of CSS you are typing (yes, there is more than one kind), you will type it in different places. Up to this point, we have been typing our code in the <head> section of our document. When typed here, it is known as an embedded stylesheet.

    4. How is CSS used?

      As we have been using it up to know, as mentioned above, we have been typing what is known as embedded stylesheets, but all types of CSS follow the same basic format.

      In the past, we have styled our pages by using the in-line tags throughout our document to change the way the text looks. With an embedded stylesheet, we put all the styles into a central location embedded in the <head> section. That way, if ever we need to change something or update the page, all we must do is go to the <head> section at the very top of the document rather than go searching around all the code of the page to make the change. This is especially useful, if, like the mid-term project, we must type a long and complicated web-page filled with much text and a complex set of tables that we do not want to accidentally mess up.

      As mentioned, the styles are embedded directly into the code in the <head> section of a document, and they are placed between a pair of <style> tags. This is the type of stylesheet that we looked at in last week’s class.

     
  6. INTRODUCE —Creating a menu using CSS: In this week's class, what I did was lead you through steps to creating a series of buttons using only CSS & XHTML. Some of the concepts we are covering are not easy to grasp at first, but once you start working on your own, I believe they will become more and more clear. This means you have to start practicing on your own if you want things to become easier.
    1. As we have learned up to now, we began with the basic elements of any webpage:
      1. the DOCTYPE: The DOCTYPE declaration defines the document type, which means what type of code you will be typing. For the purposes of this class, we will be typing XHTML strict, and the particular DOCTYPE declaration for this kind of document is:
      2. the Head section: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> This section is where information about the document might appear: the subject (title), the date, who created it, and various other data about the document that follows.
      3. the Body section: This section is where all the information of the document itself appears: all the text, the images, and any other multimedia content is referenced here between the body tags.

        The basic document structure is as follows:

        <!DOCTYPE ...>
          <html>
            <head>
              <title>... </title>
            </head>
            <body> ... </body>
          </html>



    2. In the following step, I typed some basic text elements into the document: a heading and a subheading, and then an ordered list.

      <!DOCTYPE ...>
        <html>
          <head>
            <title>... </title>
          </head>
          <body>
            <ol>
              <li>one</li>
              <li>two</li>
              <li>three</li>
            </ol>

            <h1>Example Heading Here</h1>

            <h2>Example Sub-Heading Here</h2>

          </body>
        </html>





    3. Next, I wanted to convert each of the three items in the list into a link.

      <!DOCTYPE ...>
        <html>
          <head>
            <title>... </title>
          </head>
          <body>

            <ol>
              <li>
            <a href="http://www.w3schools.com">one</a>
              </li>

              <li>
            <a href="http://www.w3schools.com">two</a>
              </li>

              <li>
            <a href="http://www.w3schools.com">three</a>
              </li>

            </ol>

            <h1>Example Heading Here</h1>

            <h2>Example Sub-Heading Here</h2>

          </body>
        </html>



    4. Now, although I didn't do this in class, I want to label each part of the body of the document that I had typed. This is done for two reasons: later on, after some time has passed, I might forget what I had intended, so typing myself some notes within the code is often very useful. Also, it helps me to organize the body into different sections in my own head so that later on I might be able to treat them differently. Usually, this is a very logical and straightforward process as follows:

      <!DOCTYPE ...>
        <html>
          <head>
            <title>... </title>
          </head>
          <body>
            <!--
              below here is
              the menu/navigation
              of the page
            //-->


            <ol>
              <li>
            <a href="http://www.w3schools.com">one</a>
              </li>

              <li>
            <a href="http://www.w3schools.com">two</a>
              </li>

              <li>
            <a href="http://www.w3schools.com">three</a>
              </li>

            </ol>

            <!--
              below here is
              the main heading
              of the page
            //-->

            <h1>Example Heading Here</h1>

            <h2>Example Sub-Heading Here</h2>

          </body>
        </html>



    5. Once again, although I did not do this in class, I want to add some new tags. I create and formalize these sections that I have mapped out in my head by placing <div></div> tag pairs around each section. By doing so, I will be able to manipulate each section or division separately later on when working with CSS. These tags do very little on their own, so until we add the CSS, the appearance of the page will change very little:

      <!DOCTYPE ...>
        <html>
          <head>
            <title>... </title>
          </head>
          <body>
            <!--
              below here is
              the menu/navigation
              of the page
            //-->
            <div>
              <ol>
                <li>
                  <a href="http://www.w3schools.com">one</a>
                </li>

                <li>
                  <a href="http://www.w3schools.com">two</a>
                </li>

                <li>
                  <a href="http://www.w3schools.com">three</a>
                </li>

              </ol>
            </div>

            <!--
              below here is
              the main heading
              of the page
              //-->
            <div>
              <h1>Example<br/>Heading<br/>Here</h1>
              <h1>Example<br/>Sub-Heading<br/>Here</h2>
            </div>


          </body>
        </html>


    6. Now that we have all the HTML on the page, we can begin to work on the CSS. As you recall, we have been typing our CSS in the head section of our document below the title between a pair of <style></style> tags. Although this has been the only place that we have typed CSS in class, it is possible, in fact, to put CSS in two other places: in separate CSS documents that are linked to the HTML document; and directly within a specific HTML tag within the body of a document. Nonetheless, in this class, we continued with placing the CSS code in the head section. This sort of CSS is known as an embedded stylesheet:

      <!DOCTYPE ...>
        <html>
          <head>
            <title>... </title>
            <style type="text/css">
              body     {background-color:#ffffaa;
                         margin-top:0px;
                         margin-bottom:0px;
                         margin-left:0px;
                         margin-right:0px;}

              h1        {color:#ccaa00;
                         font-family:Arial;
                         font-size:36pt;
                         letter-spacing:5pt;
                         word-spacing:10pt;
                         line-height:30pt;}

              h2        {color:#ffaa00;
                         font-family:Arial;
                         font-size:24pt;
                         letter-spacing:3pt;
                         word-spacing:5pt;
                         line-height:18pt;}

              a        {border-style:solid;
                         border-width:1px;
                         border-color:#ccaa00;
                         font-family:Courier;
                         font-weight:bold;
                         font-size:14pt;
                         text-decoration:none;
                         display:block;
                         padding:5px;}


            </style>


          </head>
          <body>
            <!--
              below here is
              the menu/navigation
              of the page
            //-->
            <div>
              <ol>
                <li>
                  <a href="http://www.w3schools.com">one</a>
                </li>

                <li>
                  <a href="http://www.w3schools.com">two</a>
                </li>

                <li>
                  <a href="http://www.w3schools.com">three</a>
                </li>

              </ol>
            </div>

            <!--
              below here is
              the main heading
              of the page
              //-->
            <div>
              <h1>Example<br/>Heading<br/>Here</h1>
              <h1>Example<br/>Sub-Heading<br/>Here</h2>
            </div>

          </body>
        </html>



    7. Above, we have completed the basic CSS for the page. It should style the background color for the body, its margins, the styles for the links, as well as the stlyes for the main heading and the paragraph.

      All seems fairly ordinary; however, you might have noticed that I didn't put the links into the 4 different states: a:link, a:visited, a:hover, and a:active. We use those 4 states when we want things to change about the links when the user interacts with them, when the user clicks on them, or passes the mouse over them, for example. The styles that I've applied to the links here are the styles that will stay, that we want ALL the link states to have. I will apply a couple of styles to the different states (a:link & a:hover) so that the links will change, but those that are there now will not change.

      Therefore, the next set of styles are for two of the link states so that the links DO change when the user interacts with them. Mainly, we just want the colors to change, the color of the type and the background color of the links.





      <!DOCTYPE ...>
        <html>
          <head>
            <title>... </title>
            <style type="text/css">
              body     {background-color:#ffffaa;
                         margin-top:0px;
                         margin-bottom:0px;
                         margin-left:0px;
                         margin-right:0px;}

              h1        {color:#ccaa00;
                         font-family:Arial;
                         font-size:36pt;
                         letter-spacing:5pt;
                         word-spacing:10pt;
                         line-height:30pt;}

              h2        {color:#ffaa00;
                         font-family:Arial;
                         font-size:24pt;
                         letter-spacing:3pt;
                         word-spacing:5pt;
                         line-height:18pt;}

              a        {border-style:solid;
                         border-width:1px;
                         border-color:#ccaa00;
                         font-family:Courier;
                         font-weight:bold;
                         font-size:14pt;
                         text-decoration:none;
                         display:block;
                         padding:5px;}

              a:link    {color:#000000;
                         background-color:#ffffcc;}


              a:hover   {color:#ffffcc;
                         background-color:#000000;}



            </style>



    8. The next set of styles are fairly simple, but first let me explain what the ultimate design goal is for this exercise: we want to make a horizontal menu in which each link is a rectangular button of the same size. When the user mouses over each button it changes colors.

      Right now, we have a vertical list, so we have to do to things to modify our list, we have to make it horizontal, which in XHTML speak is known as INLINE, and we have to remove the numbers of the list. That's what the next two styles do, and we'll apply them to the whole list:



      <!DOCTYPE ...>
        <html>
          <head>
            <title>... </title>
            <style type="text/css">
              body     {background-color:#ffffaa;
                         margin-top:0px;
                         margin-bottom:0px;
                         margin-left:0px;
                         margin-right:0px;}

              h1        {color:#ccaa00;
                         font-family:Arial;
                         font-size:36pt;
                         letter-spacing:5pt;
                         word-spacing:10pt;
                         line-height:30pt;}

              h2        {color:#ffaa00;
                         font-family:Arial;
                         font-size:24pt;
                         letter-spacing:3pt;
                         word-spacing:5pt;
                         line-height:18pt;}

              ol       {list-style:none;
                         display:inline;}


              a        {border-style:solid;
                         border-width:1px;
                         border-color:#ccaa00;
                         font-family:Courier;
                         font-weight:bold;
                         font-size:14pt;
                         text-decoration:none;
                         display:block;
                         padding:5px;}

              a:link    {color:#000000;
                         background-color:#ffffcc;}

              a:hover   {color:#ffffcc;
                         background-color:#000000;}


            </style>




    9. The last few styles for the menu will place the list elements or links all on the same line, side-by-side, they will give each of the buttons the same width, and then also place 5 pixels of space between each of them:



      <!DOCTYPE ...>
        <html>
          <head>
            <title>... </title>
            <style type="text/css">
              body     {background-color:#ffffaa;
                         margin-top:0px;
                         margin-bottom:0px;
                         margin-left:0px;
                         margin-right:0px;}

              h1        {color:#ccaa00;
                         font-family:Arial;
                         font-size:36pt;
                         letter-spacing:5pt;
                         word-spacing:10pt;
                         line-height:30pt;}

              h2        {color:#ffaa00;
                         font-family:Arial;
                         font-size:24pt;
                         letter-spacing:3pt;
                         word-spacing:5pt;
                         line-height:18pt;}

              ol       {list-style:none;
                         display:inline;}

              li       {float:left;
                         width:120px;
                         margin-left:5px;}


              a        {border-style:solid;
                         border-width:1px;
                         border-color:#ccaa00;
                         font-family:Courier;
                         font-weight:bold;
                         font-size:14pt;
                         text-decoration:none;
                         display:block;
                         padding:5px;}

              a:link    {color:#000000;
                         background-color:#ffffcc;}

              a:hover   {color:#ffffcc;
                         background-color:#000000;}


            </style>




    10. The very last set of styles, I will use a new thing known as an ID. I will explain more about these in class, but here I'd like to go ahead and show you how they work, so first we create the ID styles in the CSS:



      <!DOCTYPE ...>
        <html>
          <head>
            <title>... </title>
            <style type="text/css">
              body     {background-color:#ffffaa;
                         margin-top:0px;
                         margin-bottom:0px;
                         margin-left:0px;
                         margin-right:0px;}

              h1        {color:#ccaa00;
                         font-family:Arial;
                         font-size:36pt;
                         letter-spacing:5pt;
                         word-spacing:10pt;
                         line-height:30pt;}

              h2        {color:#ffaa00;
                         font-family:Arial;
                         font-size:24pt;
                         letter-spacing:3pt;
                         word-spacing:5pt;
                         line-height:18pt;}

              ol       {list-style:none;
                         display:inline;}

              li       {float:left;
                         width:120px;
                         margin-left:5px;}

              a        {border-style:solid;
                         border-width:1px;
                         border-color:#ccaa00;
                         font-family:Courier;
                         font-weight:bold;
                         font-size:14pt;
                         text-decoration:none;
                         display:block;
                         padding:5px;}

              a:link    {color:#000000;
                         background-color:#ffffcc;}

              a:hover   {color:#ffffcc;
                         background-color:#000000;}

             #menu      {padding:10px;
                         width:100%;
                         height:50px;
                         background-color:#000000;
                         border-bottom-style:dashed;
                         border-bottom-color:#ffaa00;
                         border-bottom-width:8px;}



            </style>




    11. The final step is to apply those new ID styles to a particular tag within the body section. If we do not do this, then these styles will not show up in your page. The tag I'd like to attach these styles to, then, is the first <div> tag. This will turn it into a black section across the top of the page with a dashed underline at the bottom of it.



      <!DOCTYPE ...>
        <html>
          <head>
            <title>... </title>
          </head>
          <body>
            <!--
              below here is
              the menu/navigation
              of the page
            //-->
            <div id="menu">
              <ol>
                <li>
                  <a href="http://www.w3schools.com">one</a>
                </li>

                <li>
                  <a href="http://www.w3schools.com">two</a>
                </li>

                <li>
                  <a href="http://www.w3schools.com">three</a>
                </li>

              </ol>
            </div>

            <!--
              below here is
              the main heading
              of the page
              //-->
            <div>
              <h1>Example<br/>Heading<br/>Here</h1>
              <h1>Example<br/>Sub-Heading<br/>Here</h2>
            </div>

          </body>
        </html>

      And there you have it. It isn't beautiful, but we're getting there. Perhaps, you can at this point begin to see how a webpage might begin to go together.




Thursday, June 17, 2010

Summer 2010 week 6:
6/17/10: Wednesdays 6:00 - 9:00

Hi again everyone,
This week I intensified my focus on CSS and tried to reinforce your understanding of it by simply repeating what we have already done and defining it more thoroughly. The posting below, therefore, will concentrate on CSS. I go into CSS and show you how to apply styles to the pages to create a title bar and 2 columns of content.

Please study hard the rest of this week, and please don't miss the next class. This upcoming exam is the 2nd most important grade of the term. I don't advocate missing sleep, or not eating, or not taking care of your life's necessities (family, work, etc.), but if there's ever a time to sacrifice a little bit while in school, mid-term time is certainly one of them. There will be two parts to the exam. One concerns the study sheet that I gave you, and the other is more practical, in which you will have to organize some code, and find and correct its errors. Therefore, if necessary, it is worth suffering a little by doing without an hour or two of sleep this week so you can get the stuff done and turned in to me on time.
Good luck, Carter-

  1. TOPICS:
    1. Introduce I: Cascading Style Sheets:
      1. LINK   CSS: What?
      2. LINK   CSS: Where?
      3. LINK   CSS: How?
      4. LINK   CSS: Why?
  2. HOMEWORK: Make sure that you study. As mentioned above, this is the 2nd most important grade of the term.
    1. LINK   Midterm Exam Study Sheet


    2. Do the 2-D Design Exercise below 2 TIMES for class next week. This should be in addition to what you started in class this week. This means, that you will bring THREE (3) EXAMPLES to class next week.



  3. 2-D Design Exercise:
    1. Open up Illustrator and create a file that is 12in X 12in.
    2. Turn on the rulers (cmd-R or ctrl-R) and drag guides to the 4" and 8" marks both on the top and the left-hand side ruler.

    3. Open the layers panel (F7), and name the first layer guides.
    4. Lock the first layer, and add a new one named vertical.
    5. Using the line-segment tool (\), using black as the stroke color, and 5pt as the stroke thickness, draw a line like the one you see below on the first vertical guide.
    6. Repeat this with three more lines along the other guides and on both the right and left edges of the drawing space as you see below.
    7. Draw 4 more vertical lines for the bottom portion of the drawing space as you see below.
    8. Lastly, draw 4 more segments for the middle portion of the drawing space. These new line-segments will appear to connect the top and the bottom, but make certain you have 3 line-segments for each.
    9. Lock and hide the vertical layer in the layer panel.
    10. Create a new layer named horizontal.
    11. In this new layer, repeat the actions that you took for the vertical lines and draw line segments as illustrated in the next few images.
    12. Show and unlock, both the vertical and horizontal layers
    13. Now select 3 aligned vertical segments (one whole vertical line), and change the thickness to 30pts.
    14. Then, select 3 horizontal segments (one whole horizontal line), and change the thickness to 25pts.
    15. Again, select 3 aligned vertical segments (one whole vertical line), but this time move it 1/2 the distance left or right to the next line.
    16. Also again, select 3 aligned horizontal segments )one whole horizontal line), and move it also 1/2 the distance up or down to the next line.
    17. Delete one of the horizontal and also one of the vertical segments
    18. Select two horizontal line-segments (aligned or adjacent), copy them, paste them, and then move them half the distance up or down to the next line segment.
    19. Lock both the horizontal and the vertical layers.
    20. Create a new layer named gray and put it on the bottom of the stack of layers.
    21. Using the rectangle tool, and using a very light gray fill color with NO STROKE color, draw a rectangle that colors in the space the two lines you've just moved.
    22. Deselect by holding on to the command (Mac) or control (PC) and then clicking on the background somewhere.
    23. Choose a darker gray color and draw another rectangle that colors in any ONE of the rectangles.
    24. Lock the gray layer and unlock the vertical layer.
    25. Change any 2 of the adjacent or aligned vertical segments so that they have a thickness of 50pts.
    26. Then lock the vertical layer and unlock the horizontal layer.
    27. Change any ONE of the horizontal segments so that it has a thickness of 25pts.
    28. Lock all layers and create a new layer named color. Place this layer on the bottom.
    29. Decide on any two of the white rectangles and draw rectangles that color them with 2 DIFFERENT COLORS.
    30. Decide on any two OTHER of the white rectangles and draw rectangles that color them with 2 LIGHTER versions of those same colors.
    31. Unlock all layers EXCEPT the GUIDES layer.
    32. Select all (cmd-A or ctrl-A), and then using the selection tool (V), hold down onto the shift key and rotate the 9-square 90 degrees COUNTER-CLOCKWISE.
  4. INTRODUCE I:
    1. Cascading Style Sheets (CSS)—in this week’s class we saw the introduction of the issue Cascading Style Sheets used together with HTML in order to style the text and colors of a page. CSS works often in much the same way that the in-line HTML tags (<b>, <i>, <u>, <font>, etc.) do to bring some styling onto an otherwise dull page of text. For this reason and from this point on, CSS will completely supplant those in-line tags for our uses in this class. In-line tags are not considered proper when following strict XHTML guidelines (and as a result will not pass the test when the code is validated); therefore, our job is to determine how to best configure our pages without them. In other words, from this point on, we will no longer be using many of those inline tags, and heretofore use only CSS; thereby, at last adherely completely to XHTML Strict standards.
    2. What is CSS?

      To begin with, CSS is another type of code used only to style a page of content (mostly text and images). It is used for two reasons.

      • First,

        it is vastly more extensive and, thereby, flexible. There are many more aspects of style that you can control with CSS than without it, as you will find out in the weeks to come. You can therefore control the look of your pages much more thoroughly. As a result, you will have many more options of how to style a page, using your own design sense of how to emphasize various elements in the site.

      • Second,

        as it considers a web-site as a living, changing object rather than 100% complete and fully-formed when it is uploaded onto a server, it is much more efficient to use and, therefore, allows you to update your pages much more quickly and completely.

    3. Where is CSS placed?

      depending on what kind of CSS you are typing (yes, there is more than one kind), you will type it in different places. Up to this point, we have been typing our code in the <head> section of our document. When typed here, it is known as an embedded stylesheet.

    4. How is CSS used?

      As we have been using it up to know, as mentioned above, we have been typing what is known as embedded stylesheets, but all types of CSS follow the same basic format.

      In the past, we have styled our pages by using the in-line tags throughout our document to change the way the text looks. With an embedded stylesheet, we put all the styles into a central location embedded in the <head> section. That way, if ever we need to change something or update the page, all we must do is go to the <head> section at the very top of the document rather than go searching around all the code of the page to make the change. This is especially useful, if, like the mid-term project, we must type a long and complicated web-page filled with much text and a complex set of tables that we do not want to accidentally mess up.

      As mentioned, the styles are embedded directly into the code in the <head> section of a document, and they are placed between a pair of <style> tags. This is the type of stylesheet that we looked at in last week’s class.

      1. In the first part of the class demonstration, we constructed a basic web-page with text only using only block tags, <h1>, <h2>, <p>. In some cases, we used these tags more than once each. We used the <h2> tag twice.
      2. In the second part of the demonstration, we created and applied the styles in an embedded stylesheet and applied them to the various block tags we used in the page. Where we used a tag more than once, such as the styles we attached to the <h2> tag, the styles were applied to each instance automatically by only typing them once.
        1. To create an embedded stylesheet we use the <style> tag pair.
        2. The <style> tag requires the <type> attribute with the value "text/css" applied.
        3. Inside the <style> tag pair, it is necessary to place a series of characters to convince the browsers to hide the code. While not strictly required anymore, in some old browsers, CSS code is not recognized and neither is the <style> tag. For this reason, when the code is read by these old browsers, it is mistaken for plain text and therefore displayed in the page, displacing all the actual content. Therefore, in order to prevent the browsers from doing this, it is necessary to disguise the code as HTML notes, notes that the writer of the code composes to himself or others who read the code when he wishes to identify it without having it appear in the page itself. To do this, you must type the following to open the notes: <!— — ; and the following to close the notes: //— —>.
        4. When typing CSS code, there are three (3) parts that makes up what is known as a style definition.
          1. the selector refers to the term that determines to which block of text or element the style will be applied, such as a heading or a paragraph;
          2. the property refers to the term that identifies which aspect will be styled, such as the size or color or typeface;
          3. the value refers to the term that supplies a particular quantity for a property, as the background-color property might have the value of red, or the width property might have a value of 500px;
          4. example:
             selector         property                                  value
             body   { background-color : #aa0000 ;}


    5. And, finally, why is CSS called Cascading Style Sheets? Where does the Cascading fit in? It is because CSS is implemented on three (3) levels. This is why it is called cascading, as it begins by adding style to the widest, most general location, and ends by adding it in the narrowest, most specific location. All three may be used together to style your pages in the most efficient and effective way possible.
      • linked/attached/external styles—First, for those styles that will be applied throughout your site—not only on a single page—such as a common background color, or a common set of margins, or link colors for all of the pages on your site, it is best to apply them to all pages at the same time, rather than on one page at a time. This is better because, for one thing, it is more efficient as all the styles are applied at once and centralized in one location; but by catching things in a single instance, it also prevents you from making more mistakes.

        The more you have to type the more opportunities you will have for making errors. Therefore, since you will only have to type these styles in one place for the entire site rather than on every single page, your chances for making errors are greatly reduced. For such styles as these, the most general to be applied to all, or most, pages of your web-site, you will type on a single separate document. This document will only have CSS code in it, and it will be attached, or linked, to each of the pages that will receive the stylings that it dictates. This is called a linked or attached or external stylesheet, and the document gets the extension .css.

      • embedded styles—Second, for those styles that will be applied to only a single page—you will use what’s called an embedded stylesheet. If you have a single page in a multi-page web-site that is something of an anomaly in that it must be somehow and for some reason different from the other pages (must have a different background color, or have different stylings than other pages in your web-site, for example) then you will use this type of stylesheet for those styles that must be different. These are called embedded styles because rather than being typed in a separate .css document, they are typed, embedded, directly into the HTML & centralized in the head section. This type of stylesheet is meant to style a single page, which is what makes it ideal for a page that has a number of styles that are markedly different from the general styles placed on all the pages. It is also very efficient, as it places all the styles together in the head section.

      • in-line styles—Third, for those styles that occur only one time in one particular location in one page, we tend to use what are called in-line styles. These styles are applied directly into a particular HTML tag via the style attribute. They work very much the same as in-line tags do, but are much more versatile and thorough in what types of styling you may apply in that you can do much more with them. These styles are normally used for one-time styling. If you plan on using the same styles in more than one location, then in-line styles are probably not the right CSS to use.

     
  5. INTRODUCE —Creating a menu using CSS: In this week's class, what I did was lead you through steps to creating a series of buttons using only CSS & XHTML. Some of the concepts we are covering are not easy to grasp at first, but once you start working on your own, I believe they will become more and more clear. This means you have to start practicing on your own if you want things to become easier.
    1. As we have learned up to now, we began with the basic elements of any webpage:
      1. the DOCTYPE: The DOCTYPE declaration defines the document type, which means what type of code you will be typing. For the purposes of this class, we will be typing XHTML strict, and the particular DOCTYPE declaration for this kind of document is:
      2. the Head section: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> This section is where information about the document might appear: the subject (title), the date, who created it, and various other data about the document that follows.
      3. the Body section: This section is where all the information of the document itself appears: all the text, the images, and any other multimedia content is referenced here between the body tags.

        The basic document structure is as follows:

        <!DOCTYPE ...>
          <html>
            <head>
              <title>... </title>
            </head>
            <body> ... </body>
          </html>



    2. In the following step, I typed some basic text elements into the document: a heading and a subheading, and then an ordered list.

      <!DOCTYPE ...>
        <html>
          <head>
            <title>... </title>
          </head>
          <body>
            <ol>
              <li>one</li>
              <li>two</li>
              <li>three</li>
            </ol>

            <h1>Example Heading Here</h1>

            <h2>Example Sub-Heading Here</h2>

          </body>
        </html>





    3. Next, I wanted to convert each of the three items in the list into a link.

      <!DOCTYPE ...>
        <html>
          <head>
            <title>... </title>
          </head>
          <body>

            <ol>
              <li>
            <a href="http://www.w3schools.com">one</a>
              </li>

              <li>
            <a href="http://www.w3schools.com">two</a>
              </li>

              <li>
            <a href="http://www.w3schools.com">three</a>
              </li>

            </ol>

            <h1>Example Heading Here</h1>

            <h2>Example Sub-Heading Here</h2>

          </body>
        </html>



    4. Now, although I didn't do this in class, I want to label each part of the body of the document that I had typed. This is done for two reasons: later on, after some time has passed, I might forget what I had intended, so typing myself some notes within the code is often very useful. Also, it helps me to organize the body into different sections in my own head so that later on I might be able to treat them differently. Usually, this is a very logical and straightforward process as follows:

      <!DOCTYPE ...>
        <html>
          <head>
            <title>... </title>
          </head>
          <body>
            <!--
              below here is
              the menu/navigation
              of the page
            //-->


            <ol>
              <li>
            <a href="http://www.w3schools.com">one</a>
              </li>

              <li>
            <a href="http://www.w3schools.com">two</a>
              </li>

              <li>
            <a href="http://www.w3schools.com">three</a>
              </li>

            </ol>

            <!--
              below here is
              the main heading
              of the page
            //-->

            <h1>Example Heading Here</h1>

            <h2>Example Sub-Heading Here</h2>

          </body>
        </html>



    5. Once again, although I did not do this in class, I want to add some new tags. I create and formalize these sections that I have mapped out in my head by placing <div></div> tag pairs around each section. By doing so, I will be able to manipulate each section or division separately later on when working with CSS. These tags do very little on their own, so until we add the CSS, the appearance of the page will change very little:

      <!DOCTYPE ...>
        <html>
          <head>
            <title>... </title>
          </head>
          <body>
            <!--
              below here is
              the menu/navigation
              of the page
            //-->
            <div>
              <ol>
                <li>
                  <a href="http://www.w3schools.com">one</a>
                </li>

                <li>
                  <a href="http://www.w3schools.com">two</a>
                </li>

                <li>
                  <a href="http://www.w3schools.com">three</a>
                </li>

              </ol>
            </div>

            <!--
              below here is
              the main heading
              of the page
              //-->
            <div>
              <h1>Example<br/>Heading<br/>Here</h1>
              <h1>Example<br/>Sub-Heading<br/>Here</h2>
            </div>


          </body>
        </html>


    6. Now that we have all the HTML on the page, we can begin to work on the CSS. As you recall, we have been typing our CSS in the head section of our document below the title between a pair of <style></style> tags. Although this has been the only place that we have typed CSS in class, it is possible, in fact, to put CSS in two other places: in separate CSS documents that are linked to the HTML document; and directly within a specific HTML tag within the body of a document. Nonetheless, in this class, we continued with placing the CSS code in the head section. This sort of CSS is known as an embedded stylesheet:

      <!DOCTYPE ...>
        <html>
          <head>
            <title>... </title>
            <style type="text/css">
              body     {background-color:#ffffaa;
                         margin-top:0px;
                         margin-bottom:0px;
                         margin-left:0px;
                         margin-right:0px;}

              h1        {color:#ccaa00;
                         font-family:Arial;
                         font-size:36pt;
                         letter-spacing:5pt;
                         word-spacing:10pt;
                         line-height:30pt;}

              h2        {color:#ffaa00;
                         font-family:Arial;
                         font-size:24pt;
                         letter-spacing:3pt;
                         word-spacing:5pt;
                         line-height:18pt;}

              a        {border-style:solid;
                         border-width:1px;
                         border-color:#ccaa00;
                         font-family:Courier;
                         font-weight:bold;
                         font-size:14pt;
                         text-decoration:none;
                         display:block;
                         padding:5px;}


            </style>


          </head>
          <body>
            <!--
              below here is
              the menu/navigation
              of the page
            //-->
            <div>
              <ol>
                <li>
                  <a href="http://www.w3schools.com">one</a>
                </li>

                <li>
                  <a href="http://www.w3schools.com">two</a>
                </li>

                <li>
                  <a href="http://www.w3schools.com">three</a>
                </li>

              </ol>
            </div>

            <!--
              below here is
              the main heading
              of the page
              //-->
            <div>
              <h1>Example<br/>Heading<br/>Here</h1>
              <h1>Example<br/>Sub-Heading<br/>Here</h2>
            </div>

          </body>
        </html>



    7. Above, we have completed the basic CSS for the page. It should style the background color for the body, its margins, the styles for the links, as well as the stlyes for the main heading and the paragraph.

      All seems fairly ordinary; however, you might have noticed that I didn't put the links into the 4 different states: a:link, a:visited, a:hover, and a:active. We use those 4 states when we want things to change about the links when the user interacts with them, when the user clicks on them, or passes the mouse over them, for example. The styles that I've applied to the links here are the styles that will stay, that we want ALL the link states to have. I will apply a couple of styles to the different states (a:link & a:hover) so that the links will change, but those that are there now will not change.

      Therefore, the next set of styles are for two of the link states so that the links DO change when the user interacts with them. Mainly, we just want the colors to change, the color of the type and the background color of the links.





      <!DOCTYPE ...>
        <html>
          <head>
            <title>... </title>
            <style type="text/css">
              body     {background-color:#ffffaa;
                         margin-top:0px;
                         margin-bottom:0px;
                         margin-left:0px;
                         margin-right:0px;}

              h1        {color:#ccaa00;
                         font-family:Arial;
                         font-size:36pt;
                         letter-spacing:5pt;
                         word-spacing:10pt;
                         line-height:30pt;}

              h2        {color:#ffaa00;
                         font-family:Arial;
                         font-size:24pt;
                         letter-spacing:3pt;
                         word-spacing:5pt;
                         line-height:18pt;}

              a        {border-style:solid;
                         border-width:1px;
                         border-color:#ccaa00;
                         font-family:Courier;
                         font-weight:bold;
                         font-size:14pt;
                         text-decoration:none;
                         display:block;
                         padding:5px;}

              a:link    {color:#000000;
                         background-color:#ffffcc;}


              a:hover   {color:#ffffcc;
                         background-color:#000000;}



            </style>



    8. The next set of styles are fairly simple, but first let me explain what the ultimate design goal is for this exercise: we want to make a horizontal menu in which each link is a rectangular button of the same size. When the user mouses over each button it changes colors.

      Right now, we have a vertical list, so we have to do to things to modify our list, we have to make it horizontal, which in XHTML speak is known as INLINE, and we have to remove the numbers of the list. That's what the next two styles do, and we'll apply them to the whole list:



      <!DOCTYPE ...>
        <html>
          <head>
            <title>... </title>
            <style type="text/css">
              body     {background-color:#ffffaa;
                         margin-top:0px;
                         margin-bottom:0px;
                         margin-left:0px;
                         margin-right:0px;}

              h1        {color:#ccaa00;
                         font-family:Arial;
                         font-size:36pt;
                         letter-spacing:5pt;
                         word-spacing:10pt;
                         line-height:30pt;}

              h2        {color:#ffaa00;
                         font-family:Arial;
                         font-size:24pt;
                         letter-spacing:3pt;
                         word-spacing:5pt;
                         line-height:18pt;}

              ol       {list-style:none;
                         display:inline;}


              a        {border-style:solid;
                         border-width:1px;
                         border-color:#ccaa00;
                         font-family:Courier;
                         font-weight:bold;
                         font-size:14pt;
                         text-decoration:none;
                         display:block;
                         padding:5px;}

              a:link    {color:#000000;
                         background-color:#ffffcc;}

              a:hover   {color:#ffffcc;
                         background-color:#000000;}


            </style>




    9. The last few styles for the menu will place the list elements or links all on the same line, side-by-side, they will give each of the buttons the same width, and then also place 5 pixels of space between each of them:



      <!DOCTYPE ...>
        <html>
          <head>
            <title>... </title>
            <style type="text/css">
              body     {background-color:#ffffaa;
                         margin-top:0px;
                         margin-bottom:0px;
                         margin-left:0px;
                         margin-right:0px;}

              h1        {color:#ccaa00;
                         font-family:Arial;
                         font-size:36pt;
                         letter-spacing:5pt;
                         word-spacing:10pt;
                         line-height:30pt;}

              h2        {color:#ffaa00;
                         font-family:Arial;
                         font-size:24pt;
                         letter-spacing:3pt;
                         word-spacing:5pt;
                         line-height:18pt;}

              ol       {list-style:none;
                         display:inline;}

              li       {float:left;
                         width:120px;
                         margin-left:5px;}


              a        {border-style:solid;
                         border-width:1px;
                         border-color:#ccaa00;
                         font-family:Courier;
                         font-weight:bold;
                         font-size:14pt;
                         text-decoration:none;
                         display:block;
                         padding:5px;}

              a:link    {color:#000000;
                         background-color:#ffffcc;}

              a:hover   {color:#ffffcc;
                         background-color:#000000;}


            </style>




    10. The very last set of styles, I will use a new thing known as an ID. I will explain more about these in class, but here I'd like to go ahead and show you how they work, so first we create the ID styles in the CSS:



      <!DOCTYPE ...>
        <html>
          <head>
            <title>... </title>
            <style type="text/css">
              body     {background-color:#ffffaa;
                         margin-top:0px;
                         margin-bottom:0px;
                         margin-left:0px;
                         margin-right:0px;}

              h1        {color:#ccaa00;
                         font-family:Arial;
                         font-size:36pt;
                         letter-spacing:5pt;
                         word-spacing:10pt;
                         line-height:30pt;}

              h2        {color:#ffaa00;
                         font-family:Arial;
                         font-size:24pt;
                         letter-spacing:3pt;
                         word-spacing:5pt;
                         line-height:18pt;}

              ol       {list-style:none;
                         display:inline;}

              li       {float:left;
                         width:120px;
                         margin-left:5px;}

              a        {border-style:solid;
                         border-width:1px;
                         border-color:#ccaa00;
                         font-family:Courier;
                         font-weight:bold;
                         font-size:14pt;
                         text-decoration:none;
                         display:block;
                         padding:5px;}

              a:link    {color:#000000;
                         background-color:#ffffcc;}

              a:hover   {color:#ffffcc;
                         background-color:#000000;}

             #menu      {padding:10px;
                         width:100%;
                         height:50px;
                         background-color:#000000;
                         border-bottom-style:dashed;
                         border-bottom-color:#ffaa00;
                         border-bottom-width:8px;}



            </style>




    11. The final step is to apply those new ID styles to a particular tag within the body section. If we do not do this, then these styles will not show up in your page. The tag I'd like to attach these styles to, then, is the first <div> tag. This will turn it into a black section across the top of the page with a dashed underline at the bottom of it.



      <!DOCTYPE ...>
        <html>
          <head>
            <title>... </title>
          </head>
          <body>
            <!--
              below here is
              the menu/navigation
              of the page
            //-->
            <div id="menu">
              <ol>
                <li>
                  <a href="http://www.w3schools.com">one</a>
                </li>

                <li>
                  <a href="http://www.w3schools.com">two</a>
                </li>

                <li>
                  <a href="http://www.w3schools.com">three</a>
                </li>

              </ol>
            </div>

            <!--
              below here is
              the main heading
              of the page
              //-->
            <div>
              <h1>Example<br/>Heading<br/>Here</h1>
              <h1>Example<br/>Sub-Heading<br/>Here</h2>
            </div>

          </body>
        </html>

      And there you have it. It isn't beautiful, but we're getting there. Perhaps, you can at this point begin to see how a webpage might begin to go together.