Show off your peacock feathers as you begin to spread your wings and take flight into the world software development. Okay, peacocks can’t fly, but you get the point - your portfolio will give you a place to work and show off your coding projects!
🎯 Goal: Create a portfolio page for your website. This page will contain links to your projects and serve as a showcase for your coding skills.
You’re building a website that will be live on the internet through your GitHub page. It’s designed to be viewed in any web browser, like Chrome.
🎯 Goal: Follow the steps in this lesson to build and customize your website one step at a time.
📂 Open the portfolio.html file in your codespace to get started.
<head> or <body>).🖥️ Preview your site regularly using Live Server to see how your changes affect the website.
🎯 Goal: Preview your site in the browser to see how it looks and behaves as you make changes.
There are two ways to open your project with Live Server:
index.html file in the file tree on the left side of your codespace.index.html and select “Open with Live Server.”
🎯 Goal: Build a new portfolio page from scratch.
🔍 Find the file tree
Open the portfolio.html file
portfolio.html to open it.Add the following boilerplate HTML to your file to set up the basic structure:
<!DOCTYPE html>
<html>
<head>
<title>CHANGE ME</title>
</head>
<body>
<!-- All content goes here -->
<div id="all-contents">
</div>
</body>
</html>
🎯 Goal: Add a title to your portfolio page to match the one on your homepage.
🔍 Locate the <title> element inside the <head> element
Update the text inside <title>
CHANGE ME with to match the title you added to your home page.Your updated <head> tag should look like this:
<head>
<title>My Awesome Website</title>
</head>
🎯 Goal: Organize your webpage by adding two key sections — a navigation menu and a main content area. You’ll do this by placing <nav> and <main> elements inside the <div id="all-contents"> element.
🔍 Locate the <div id="all-contents"> element
Find this part of the code:
<!-- All content goes here -->
<div id="all-contents">
</div>
Place the <nav> and <main> elements inside the <div id="all-contents"> element
Your code should now look like this:
<div id="all-contents">
<nav>
</nav>
<main>
</main>
</div>
<nav> and <main> elements are inside the <div id="all-contents"> element.
🎯 Goal: Give your site a title and create a navigation menu to help visitors move between pages.
🔍 Find the <nav> element
Look for the following section in your code:
<nav>
</nav>
Add a title inside the <nav> element
<h1> element inside <nav>. Between the opening and closing <h1> tags, type the title of your website. Use the same text you used for your home page to stay consistent.
<h1>Your Name's Amazing Website</h1>
Create an unordered list for your navigation menu
Below the <h1> element, add a <ul id="nav-ul"> element:
<ul id="nav-ul">
</ul>
Add two list items for the menu
Inside the <ul> element, add the following two <li> elements:
One to link to your home page
<li class="nav-li">
<a href="index.html">Home</a>
</li>
Another to link to your portfolio page
<li class="nav-li">
<a href="portfolio.html">Portfolio</a>
</li>
After completing this TODO, your <nav> section should look like this:
<nav>
<h1>Your Name's Amazing Website</h1>
<ul id="nav-ul">
<li class="nav-li">
<a href="index.html">Home</a>
</li>
<li class="nav-li">
<a href="portfolio.html">Portfolio</a>
</li>
</ul>
</nav>
<h1> and <ul> elements are inside the <nav> element.
🎯 Goal: Add a section to display your projects.
🔍 Find the existing <main> element in portfolio.html.
It should look like this:
<main>
</main>
Create a new section to hold the content:
<div> element inside the <main> element.class="content" attribute to the new <div>.Add a header inside the new <div> to label this section:
<h1> tag inside the <div class="content">Portfolio inside the new <h1>.Create an empty unordered list to display your projects later:
<ul> element below the <h1> tag.id="portfolio" attribute to the <ul> elemntAfter completing these steps, your <main> section should look like this:
<main>
<div class="content">
<h1>Portfolio</h1>
<ul id="portfolio">
</ul>
</div>
</main>
🎯 Goal: Add links to your upcoming projects.
🔍 Find the <ul id="portfolio"> element you added in the previous step.
Add these three <li> elements with links to your projects into the <ul> element:
<li>
<a href="fsd-projects/platformer/">Platformer: A cannon-dodging adventure game for Halleb0t</a>
</li>
<li>
<a href="fsd-projects/bouncing-box/">Bouncing Box: A fun introduction to web game development</a>
</li>
<li>
<a href="fsd-projects/circularity/">Circularity: A poetic motion experiment with circles</a>
</li>
🎯 Goal: Link your CSS stylesheet and style the portfolio page.
🔍 Find the <head> tag inside portfolio.html.
Add a <link> tag inside the <head> element to link the CSS file.
rel="stylesheet" attribute and href="style.css" attribute inside the <link> tag
<head>
<title>Your Name's Website</title>
<link rel="stylesheet" href="style.css" />
</head>
style.css file and add the following styles to the bottom of the file:
/* Portfolio styles */
.content h1 {
color: black;
}
#portfolio {
list-style-type: none;
padding-left: 0;
}
#portfolio li {
background: #fff;
padding: 10px;
border-radius: 10px;
margin-bottom: 10px;
}
#portfolio li:hover {
background: #eee;
}
#portfolio a {
text-decoration: none;
color: #454545;
}
Here’s some other things to try:
border-radius property to the nav selector to give the <nav> element rounded cornersindex.html and portfolio.html files. Favicons are cool ways to customize your page!
Here’s some CSS to get you started on making your website mobile responsive. You can add this code to the bottom of your CSS file.
/* responsive web design */
@media screen and (min-width: 120px) and (max-width: 1080px) {
main {
height: 100ch;
zoom: 1.5;
display: grid;
}
h1 {
font-size: 44px;
}
h2 {
font-size: 42px;
}
h3 {
font-size: 36px;
}
#all-contents {
height: 100ch;
margin: none;
}
a {
font-size: 42px;
}
.sidebar {
margin-right: 0px;
justify-content: center;
align-items: center;
}
.sidebar-img {
width: 100%;
}
p,
li {
font-size: 24px;
}
.content {
align-content: center;
justify-content: center;
}
}
If you made any changes in the “Extra Challenges” section:
🎯 Goal: Push your changes to GitHub and make your portfolio go live.
Open the terminal in your codespace
Enter the following commands one by one in the terminal, pressing enter after each command to run it:
git add .
git commit -m "add portfolio page to website"
git push
Wait a few minutes for the changes to go live at your-username.github.io.
your-github-username.github.io to see your website live on the internet. If it doesn’t appear immediately, wait a few minutes and try refreshing your page.
"your-github-username" with your actual github username when entering the URL in your browser.