In this task you will use template content to add desktop and mobile menus to the ‘Software Analytics’ project you created earlier and to which you then added an email sign-up form and a footer
You can display a finished version of the project web page by clicking the image below.
At the end of this Tutorial you will be able to:
Downloading the website logo image
Working with your two HTML files
Copying-and-pasting the menus HTML and JavaScript
Working with the template CSS file
Copying and renaming the template CSS file
Removing browser resets from the new menus CSS file
About the font-family for the menus
Linking your web page to the new menus CSS file
Updating the menu logo and hyperlink
Updating the menu option hyperlinks
Creating the hyperlink destinations
Offsetting the hyperlink destinations
Updating the hero block spacing
Updating the mobile menu content and hyperlinks
Your first step is to download the image file for this project’s website logo.



Your img sub-folder for this project will now look as shown below.
You will begin by working with two HTML files:


If you have any other files open in Visual Studio Code, you may wish to close them.
This will help you to focus only on the two HTML files you will be working with.
Your next step is to copy content from the menus template file into your index.html web page.


You can close the menus-template.html file. You are now finished working with this template.
Your next set of tasks involves making a copy of the template stylesheet file, renaming it, and then linking the renamed copy to your index.html project web page. You will also make some changes to the copied and renamed stylesheet.
First, you will make a copy of the template stylesheet for menus.


You can close the menus-template.css stylesheet. You are now finished with this template CSS file.
Now you will delete the web browser resets from your copied and renamed stylesheet.

In your project style.css stylesheet, at about line 9, you can see that the font-family for the entire web page is set to the Google Font of ‘Roboto’.
This font is an easy-to-read at the small font sizes used for menu options. So you do not need to set a different font-family style for the text in the desktop and mobile menus.
Next, you will link the stylesheet you have just copied, renamed and edited to your project web page.

For both the desktop and mobile menus, you need to update logo image and hyperlink.
<a href="#"><img src="assets/img/software-logo.png" alt="website logo"></a>

In your web browser, the web page should look as shown below.
For both the desktop and mobile menus, you need to update the hyperlinks for the various menu options.
<ul> <li><a href="#features">Features</a></li> <li><a href="#benefits">Benefits</a></li> <li><a href="#testimonials">Testimonials</a></li> <li><a href="#free-trial" class="btn-cta">Start Your Free Trial</a></li> </ul>

Now that you have created hyperlinks in the desktop and mobile menus, you need to create the destinations in the web page that these links will bring the user to.
The Email Sign-up Form already has an ID named "free-trial".View the result in your web browser for both desktop and mobile screen sizes. Verify that the menu options all work correctly when clicked/tapped.
Because both the desktop/laptop and mobile parent containers are ‘sticky’, the menus remain fixed at the top of the screen as the user scrolls down through the web page.
This also means that the top 72px of whatever web page element immediately follows the parent menu containers is ‘hidden’ behind them.
When you click or tap a menu option, you can see that the top of the destination heading is partly ‘hidden’ behind the menubar.
To fix this issue, follow these steps:
Give this new property a value of 72px, which is the same height as the height of your desktop and mobile menu containers.You can see that the menu containers no longer hide any of the web page content.
Because of the ‘sticky’, menus that hide the upper 72px of the web page element follows them, you need to make a few changes to the spacing around and within the hero block at the top of your web page.


In your web browser, the web page should look as shown below.
In the lower part of the mobile menu, under the <hr> horizontal rule line, you can include some text about yourself, an image and some hyperlinks.
<img src="assets/img/profile-pic.jpg" alt="Mary Smith, Web Designer">
<a href="../../index.html">Home</a>
<a href="../index.html">Portfolio</a>
<a href="../../contact/index.html">Contact</a>
In your web browser, the web page should look as shown below on mobile screens.
In the menus-template.html file you copied-and-pasted into your index.html web page, the CSS class of menu-light is assigned to the desktop and mobile menus. As a result:
Let’s replace this default colour of red with the green colour of #5ba745 used elsewhere in the web page.

In your web browser, the web page should look as shown below.
Your final step is to use some JavaScript code in the menus-template.html file you copied-and-pasted into your index.html web page to create the following effect:

To achieve this effect, follow these steps.



In your web browser, the web page should look as shown below as you scroll down and back up the screen.
When the user scrolls down the web page:
When the user scrolls back up the web page:
That’s it. You have now completed your ‘Software Analytics’ project.
You can display a finished version of the project web page by clicking the image below.
The final step is to upload your project to GitHub.
All the files you have updated for this project are in the software sub-folder of your websites/portfolio folder.
So the easiest option is simply to upload the entire software sub-folder to your account on GitHub.





Your updated ‘Software Analytics’ project web page 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:
https://username.github.io/portfolio/software/index.html
or, simply:
https://username.github.io/portfolio/software
It may take a few minutes for your uploaded files to appear on GitHub.
Return to Contents.