You'll build on your Introduction project to add semantic HTML elements that help you structure your page.
It'll have the following features:
Command + Shift + A on MacOS or Ctrl + Shift + A on Windows)Now you're ready to get coding!
Create another file called bff.html then copy and paste the code below into your new file.
<h1> Introduce Yourself </h1>
<h2> My Best Friend(s) </h2>
<ul>
<li>
<img src="...">
<p> Name... </p>
</li>
<li>
<img src="...">
<p> Name... </p>
</li>
<li>
<img src="...">
<p> Name... </p>
</li>
</ul>
src attribute to the name of the image file.Create a link to bff.html in your index.html file, and another link to index.html in your bff.html file. This way, visitors can go back and forward between the pages on your site.
Usually, links to other pages are somewhere near the top of a web page, like this.
<h1>
Introduce Yourself
</h1>
<a href="bff.html">
My Friend(s)
</a>
<h2>
About Me
</h2>
<p>
A paragraph about me.
</p>
<p>
My interests include:
</p>
<ul>
<li> Thing 1 </li>
<li> Thing 2 </li>
<li> Thing 3 </li>
</ul>
The header element is a section, usually at the top of the page, that contains the name of the website, a logo, and other things that are the same on every page.
Usually, the header is the same or similar on every page.
Try putting your main heading inside a header element.
<header>
<h1> Introduce Yourself </h1>
</header>
Change your header to personalise your web page.
The nav element contains all the navigation links for your page. The navigation menu is usually the same on every page, so that visitors can move around however they want.
Add a nav element around the link on your page so that it's contained inside.
<nav>
<a href="bff.html"> My Friend(s) </a>
</nav>
The main element is the... main part of your page. It contains all the content that's specific to this page, so it should be different on every page.
Add a main element around the main content of your page so that it's contained inside.
<main>
<h2> About Me </h2>
<p>
A paragraph about me.
</p>
<p>
My interests include:
</p>
<ul>
<li> Thing 1 </li>
<li> Thing 2 </li>
<li> Thing 3 </li>
</ul>
</main>
The footer element usually contains copyright information about the content on the page and the code behind the page. It can include the author who wrote the code, who they work for, and contact information.
Add a footer element at the bottom of your page with as much of this information as you want to include. You at least need to claim copyright on the work you've done.
<footer>
<p>
© Your Name 2023
</p>
</footer>
Change your footer to personalise your web page.
Congratulations, the second iteration of your web page is complete.
You've taken the code provided and customised it to create your unique web page.
Along the way, you've learnt about these parts of coding.
(➕ means new things in this project)
HTML code
h1 for main headingsh2 for subheadingsp for paragraphsul for unordered lists (bullet points)li for list items inside an unordered liststyle for CSS stylinga for linkshref attribute in a opening tagsimg for imagessrc attribute in img opening tags➕ header for page headers
➕ nav for navigation menus
➕ main for the main page content
➕ footer for page footers
HTML vocabulary
< and >CSS code
background: to change the background colour of an elementfont-family: to change what letters look likefont-size: to change the size of textcolor: to change the colour of texttext-align: to move text to the left, center, or righttext-decoration: to add or remove underlines and line-throughstext-transform: to change text to all uppercase or lowercasetext-shadow: to add a shadow to textmargin-(top, bottom, left, right): to add space around the outside of an elementpadding-(top, bottom, left, right): to add space around the inside of an elementwidth: for the widthheight: for the heightCSS vocabulary
Add a style element to the bottom of your page and apply some of the CSS skills you've been developing.