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
- Open your home page, index.html for editing.
- 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. - Add an unordered list
<ul>
to your home page.- The list should be located in the
main
element at the end (before the closing</main>
tag). - Your list must have at least three (3) list items, listing your favorite temples.
- The listed temples must be text links to a temple detail page using the Temple List at churchofjesuschrist.org or Newsroom Temples List or unofficially the Temples of the Church of Jesus Christ of Latter-day Saints ORG
- These links must open up a new browser tab when selected.
Hints
The Unordered List element - MDN
HTML <a> Attribute - w3schools
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>
- The list should be located in the
- Open your styles.css page for editing.
- 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 ofborder-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 - MDNCheck Your Understanding
* { margin: 0; padding: 0; box-sizing: border-box; }
- Set the
- 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 */
- 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
Adjusted.box { margin: 1rem; border: 1px solid rgb(0 0 0 / .1); padding: 1rem; background-color: #ddd; color: #000; }
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? - In your HTML, give the
aside
element a class of box.Check Your Understanding
<aside class="box">
- 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? -
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.
Check Your Understanding
main img { /* you most likely will have other declarations here */ float: right; }
-
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 aposition: 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; }
- 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
.
- an external link to your LinkedIn profile if you have one. If you do not have one, link to
Help
Video Demonstration: ▶️ Enhancing the Course Home Page
Testing
- Be sure to continuously save and test your page locally using the Live Server extension in VS Code.
- Review your work using the course's development standards checklist.
- Commit and sync your page to your remote GitHub Pages enabled wdd130 repository.
- Enter your GitHub username into this page evaluation tool to self evaluate some of the basic structure and components of your work.