If you have not already downloaded the HTML, CSS and image template files for use with this and your other projects, you can find the instructions at the link below.
Your first step is to download the image file for the new ‘Contact Form’ web page you will create.
Right-click the image below and, from the context menu displayed, choose Save Image As
Download the image file to your websites\portfolio\web-agency\assets\img sub-folder:
Creating your Contact Form web page
Your new Contact Form web page will be similar in design to the already existing three pages in your sample ‘Web Agency’ website and will use the same stylesheet.
So you can use the current home page index.html file as the basis for creating the new page.
Start Visual Studio Code and follow these steps.
From your websites\portfolio\web-agency folder, open the web page named index.html.
From the File menu, choose the Save As command.
Save the HTML file in the same folder as the project’s three other web pages, and give the new file the following name:
contact.html
You are now ready to edit your new contact.html web page.
Editing your Contact Form web page
You need to update the content of your new contact.html web page.
In Visual Studio Code, edit the <h1> and <h2> headings in the hero section by replacing the current text with the following:
<h1>Your partner in digital success</h1>
<hr>
<h2>Working with clients to build digital campaigns rich in vision, meaning and creativity.</h2>
Replace the image file used in the hero section with this one.
After the end of the hero block, you can delete the rest of the HTML and text on this page.
Remove everything all the way down to the closing </body> tag.
When finished, save your contact.html web page.
In your web browser, the contact.html web page should now look as shown below.
Working with the template HTML file
In this next step, you will work with two HTML files:
The template file you will copy from and
The web page you will copy to.
In Visual Studio Code, from your websites\templates folder, open the following HTML file:
contact-form-template.html
From your websites\portfolio\web-agency folder, open the web page named contact.html.
If you have any other files open in Visual Studio, you may wish to close them.
This will help you to focus only on the two HTML files you will be working with.
Adding the <head> link for the Font Awesome icons
Your contact form will use a Font Awesome 5 icon. So you need to include a link to the Font Awesome stylesheet CSS file.
In the <head> of the contact.html the web page, just before the closing </head> tag, copy-and-paste the following comment line and code.
<!-- Link to icons for Font Awesome 5 -->
<linkhref="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css"rel="stylesheet"integrity="sha512-1PKOgIY59xJ8Co8+NE6FZ+LOAZKjy+KY8iq0G4B3CyeY6wYHN3yt9PW0XpSriVlkMXe40PTKnXrLnZ9+fkDaog=="crossorigin="anonymous">
The pasted comment and Font Awesome link should now look as follows.
When finished, save your contact.html web page.
Copying-and-pasting the Contact Form HTML
Your next step is to copy content from the template file into your web page.
In the contact-form-template.html file, select and copy the contact form content.
In your contact.html web page, scroll down to near the end of the web page, to just before the closing </body> tag.
Press the ENTER key a few times to open up some new lines of blank space.
Paste the copied contact form content.
When finished, save your contact.html web page.
You can now close the contact-form-template.html file. You are finished working with it.
Working with the template CSS file
In your next step you will work with two CSS files:
The template CSS file you will copy from and
The stylesheet you will copy to.
In Visual Studio Code, from your websites\templates folder, open the following CSS file:
contact-form-template.css
From your websites\portfolio\web-agency\assets\css folder, open your stylesheet named style.css.
If you have any other files open in Visual Studio, you may wish to close them.
This will help you to focus only on the two CSS files you will be working with.
Copying-and-pasting the Contact Form CSS
In this step you will copy from the contact form template CSS file into your style.css file.
In your contact-form-template.css CSS file, select and copy the contact form section.
In your style.css file, scroll down to the end of the stylesheet and click on the last empty line.
Press the ENTER key a few times to open up some new lines of blank space.
On the new last line, paste the copied contact form styles.
When finished, save your style.css stylesheet.
You can now close the contact-form-template.css file. You are finished working with it.
In your web browser, the contact-us.html web page should now look as shown below.
Updating your form content and appearance
You have now successfully added a fourth page containing a functional Contact Form to your portfolio website. All that remains is to:
Edit the text of the Contact Form to match the website content.
Create a link to the Contact Form from the home page of the website.
Update the visual style of the Contact Form to blend with the website’s three other pages.
Editing the text of your Contact Form
Here are the final steps to editing the text content of your Contact Form web page.
In the contact.html file, replace the <h3> sub-heading and the <p> paragraph text as follows.
<h3>Let's talk</h3>
<p>Do you have a project you'd like to discuss with us. If so, please complete and submit this form.</p>
Update the form’s action value by copying-and-pasting the endpoint value from Formspree. See the example shown below.
You can now save and close the contact.html web page.
Linking to your Contact Form
Now that you hve added a Contact Form web page to your project, let’s add some hyperlinks to the Contact Form page from the website’s three other pages.
In the index.html file, scroll down to the end of the web page.
You will see the following final sentence.
Enclose this sentence within a hyperlink as shown below.
<aclass="fancy-link"href="contact.html">Get in touch for a quick quote</a>
Open the services.html web page, and add a hyperlink with a class of fancy-link that links to the contact.html page to the “Let’s chat” text near the bottom of the page.
Open the team.html web page of this project, and add a hyperlink with a class of fancy-link that links to the contact.html page to the “Get in touch” text near the bottom of the page.
<aclass="fancy-link"href="contact.html">Get in touch</a>.
In your web browser, display the web pages and click the hyperlinks to verify they work correctly.
Updating the visual style of your Contact Form
Your final step is to update the visual appearance of the Contact Form.
In the style.css file, change the font colours of the form’s <h3> sub-heading as shown below.
Change the colour of the <p> paragraph text as shown below.
Change the background colour value for the .container-contact-form style as shown below.
Change the background and border colours of the form fields as shown below.
Change the background-color value for the ‘Submit’ button as shown below.
Save and close your style.css file.
That’s it. You are now finished working with your Contact Form page.
You can display a finished version of the Contact Form web page by clicking the image below.
Uploading your project to GitHub
The final step is to upload your project to GitHub.
All the files you have updated and added for this project are in the web-agency sub-folder of your websites/portfolio folder.
So the easiest option is simply to upload the entireweb-agency sub-folder to your account on GitHub.
If you are not already signed in to your GitHub account, sign in now.
On the left of your GitHub home page, click the name of the repository that holds your web pages.
On the next GitHub screen displayed, click the portfolio folder.
GitHub should now display your portfolio folder.
With the portfolio folder displayed on your GitHub screen, click the Add file button and, from the dropdown list displayed, choose the option Upload files.
In File/Windows Explorer on your computer, display your portfolio folder and then drag-and-drop the web-agency folder to the GitHub tab in your web browser.
After uploading the web-agency folder, scroll down to the bottom of the GitHub screen, enter a short message in the Commit changes box, click the Commit changes button, and wait for the upload to complete.
Your updated ‘Web Agency’ project is now published on GitHub at a web address similar to the following, where username is the username you have chosen for your GitHub account: