WDD 130: Web Fundamentals

W03: Enhancing Your Course Home Page

Overview

This practice activity has you apply the concepts from the learning activities to enhance your home page with HTML references, using the CSS box model, CSS selectors, and layout.

Activity Instructions

  1. Open your home page, index.html for editing.
  2. Add an HTML comment at the bottom of the document, after the closing </body> tag, that contains the date that you have last modified the page.
  3. Add an unordered list <ul> to your home page.
    Check Your Understanding
    <ul>
      <li><a href="https://www.churchofjesuschrist.org/temples/details/philadelphia-pennsylvania-temple" target="_blank">Philadelphia Pennsylvania Temple</a></li>
      <li><a href="https://www.churchofjesuschrist.org/temples/details/paris-france-temple" target="_blank">Paris France Temple</a></li>
      <li><a href="https://www.churchofjesuschrist.org/temples/details/lima-peru-los-olivos-temple" target="_blank">Berlin Germany Temple</a></li>
    </ul>
  4. Open your styles.css page for editing.
  5. At the top of the document, create a CSS rule for the universal selector (wildcard) that contains three declarations:
    • Set the margin shorthand property to 0.
    • Set the padding shorthand property to 0.
    • Set the box-sizing property to border-box.

    Setting the universal selector to have a margin and padding of zero (0) will ensure that all elements on the page will have no margin or padding, regardless of the browser defaults. This will make it easier for you to control the page layout.

    When the border-sizing property is set to the non-default value of border-box, this tells the browser to account for any border and padding in the values you specify for an element's width and height. - Box-sizing - MDN

    Check Your Understanding
          * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }
  6. Add a CSS comment at the bottom of your stylesheet that creates a comment header for a section called "Class Selectors". You will be putting your class selector rules below this comment.
    Check Your Understanding
    /* Class Selectors */
  7. Add a class selector to your CSS after the comment. Name it "box".
    • Style the box class with basic box model properties for margin, border, padding.
    • Set the value of the margin and padding to equal 1rem which means, match the root font size.
    • Also add decorations of background-color and color of your own design.
    • Remove any duplication of these properties from the aside CSS rule.
    Check Your Understanding
    .box {
      margin: 1rem;
      border: 1px solid rgb(0 0 0 / .1);
      padding: 1rem;
      background-color: #ddd;
      color: #000;
    }
    Adjusted aside rule example. (Your aside may have other properties. This is just an example.)
    aside {
      width: 20em;
      text-align: center;
    }
    Did you miss the period (.) in your syntax when defining the box class?
  8. In your HTML, give the aside element a class of box.
    Check Your Understanding
    <aside class="box">
  9. In your HTML, given the ul element list of temples a class of box.
    Check Your Understanding
    <ul class="box">
    Are you observing and noting the changes by running Live Server (localhost) while you make changes and build your page?
  10. Use CSS to float your profile image to the right. The paragraph should come right after the picture. If your introduction is too short, you may need to add more content to ensure that the layout looks appropriate.
    Floated profile image example
    Figure 1: Float Profile Image Example
    Check Your Understanding
          main img {
      /* you most likely will have other declarations here */
      float: right;
    }
  11. Screenshot of heading overlay
    Figure 2: Heading Overlay Example
    Using CSS absolute positioning, overlay the the state/country heading element on the image within the aside element.
    This means that you will need to set the container, aside, to have a position: relative; declaration.
    Check Your Understanding These numbers for top and left may not work for your image. This is just an example.
    aside h2 {
      position: absolute;
      top: 47px;
      left: 150px;
    }
  12. In your HTML nav navigation bar, add two (2) more <a> links:
    • an external link to your LinkedIn profile if you have one. If you do not have one, link to https://linkedin.com.
    • an external link to your Facebook page you have one. If you do not have one or would prefer not to share it, link to https://facebook.com.

Help

Video Demonstration: ▶️ Enhancing the Course Home Page

Testing

  1. Be sure to continuously save and test your page locally using the Live Server extension in VS Code.
  2. Review your work using the course's development standards checklist.
  3. Commit and sync your page to your remote GitHub Pages enabled wdd130 repository.
  4. Enter your GitHub username into this page evaluation tool to self evaluate some of the basic structure and components of your work.