To Lecture Notes

IT 238 -- Jan 8, 2025

Review Questions

  1. What does HTTP mean? List some other web transmission protocols that you know.
    Answer: HTTP means Hypertext Transfer Protocol. Some other protocols are: HTTPS (Hypertext Transmission Protocol Secure), FTP (File Transfer Protocol), SFTP (FTP over Secure Shell), FTPS (FTP over Secure Sockets Layer / Transport Layer).
  2. Set up an HTML page that uses some of the tags that you know from Exercise 1. Use more HTML tags than you did for Exercise 2 in the Jan 6 Notes. Add an external stylesheet. Answer:
    Exercise2 Example
    Web Page 1   Web Page 2   Source Code
  3. How does HTML5 differ from earlier versions of HTML?
    Ans: Simplified validation tag <!DOCTYPE html>
    many new tags, some deprecated tags are no longer used, such as <font> and <center>, runs on newer browsers, support for audio and video, support for vector graphics, and drawing in a canvas.
  4. What are inheritance and specificity for CSS property values?
    Answer: Inheritance means that if a CSC property is not specified for an HTML element, the property value of the parent is used. For example, if a CSC property is not specified for an h1 header, the property value of the parent, which is the body is used. Not all elements support inheritance, so you need to check. For example, if the font color for the h1 headers are not specified, but this CSS style is included
    body { color: navy; }
    
    The color for all h1 headers will be navy because they inherit the color from the parent tag body.

    Specificity means that if more than one property applies to an element, the most specific property is used, the most specific is to target an element with an exact id, next most specific is to target an element that uses a designated class, third is to use a property that targets a specific element type. If two properties are equally specific, the property that is specified last is used. For example, if these two tags are used,
    h1 { color: navy; }
    body { color: maroon; }
    
    The color of the h1 tag will be navy because h1 is more specific than body.

    Finally, if more than applies equally to a tag, the style that is applied last takes precedence, for example:
    h1 { color: navy; }
    h1 { color: maroon; }
    
    In this case, the maroon color is applied last to the h1 tag will be maroon.
  5. Which colors are designated by these hex color codes:
    #ff00ff  #800080  #000080  #800000  
    #008080  #c0c0c0  #e0e0ff  #e0ffff
    
    Hint: Here is a color wheel to help you.
    Ans:
    #ff00ff magenta or fuschia #800080 purple
    #000080 navy               #800000 maroon
    #008080 teal               #c0c0c0 silver
    #e0e0ff pastel blue        #e0ffff pastel aqua or cyan
    
  6. What does this CSS statement define?
    .twf { font-family: "Courier New"; 
           font-weight: bold; }
    
    Ans: This is a CSS class. The leading dot on the class name .twf indicates that this class can be used on any selector. In the HTML code, to apply this class to a selector, for example <p> (paragraph), add a class attribute to the tag:
    <p class="twf">This is a paragraph.</p>
    
  7. What is the CSS box model?
    Answer: The box model controls how much space is between an element and its border (padding) and the space between its border and adjacent elements. Here is an example:
    BoxModel Example
    Web Page   Source Code
  8. How do you write comments in HTML, CSS, and JavaScript code?

Practice Quiz

Project 0

CSS Shorthand Styles

Some HTML5 Examples

  1. Details Example
    Use a details element to hide information:
    Web Page  Source Code
  2. Table Example
    A table with HTML5 elements:
    Web Page  Source Code
  3. Iframe Example
    Use an <iframe> tag to display text:
    Web Page  Source Code
  4. Drawing1 Example
    Draw two shapes (circle and polygon) using scalable vector graphics (SVG).
    Web Page  Source Code
  5. Drawing2 Example
    Drawing can also be accomplished using JavaScript:
    Web Page  Source Code

Some CSS Examples

  1. AbsolutePositioning Example
    Display div sections using absolute positioning and a background image.
    Web Page  Source Code
  2. Float Example
    Use the CSS float property to allow text to flow around an image.
    Web Page  Source Code