All Tutorials  >

Working with Hyperlinks

IBAT Next Course

Learning Goals

At the end of this Tutorial you will be able to:

You can view a finished version of this project by clicking the image below.

GitHub image

Contents

About hyperlinks

Hyperlink destinations

The four hyperlink states

Your two work files: base-8.html and base-8.css

Using internal hyperlinks for page navigation

Styling hyperlinks

Hyperlinks styled as buttons

Hyperlinks styled as solid buttons

Hyperlinks styled as ghost buttons

Styling button shapes

Adding icons with Font Awesome

Updating the <head> of your web page

Validating your web page

Validating your stylesheet

Uploading your two files to GitHub

Further resources

Your two work files: base-8.html and base-8.css

In this Tutorial you will work with these two files:

First, let’s edit the HTML file from your previous Tutorial:

  1. In your text editor, open the file named base-7.html.
  2. In the <head> of the base-7.html file, change the title as follows:  
    
    <title>Responsive web page with hyperlinks</title>
    
  3. Also in the <head>, change the description as follows:  
    
    <meta name="description" content="A sample responsive web page with examples of hyperlinks.">
    
  4. Also in <head>, change the stylesheet link as follows:  
    	
      <link rel="stylesheet" href="base-8.css">
    
  5. Use the File | Save As command to save your HTML file with the following new name:   base-8.html
  6. Switch to the base-7.css file, and use the File | Save As command to save the file with this new name:   base-8.css

You are now ready to work with your new web page (base-8.html) and stylesheet (base-8.css).

Updating the <head> of your web page

Before you validate your web page and upload it to GitHub, ensure the following details are correct within the <head> of your base-8.html file.

GitHub image

Validating your web page

To check the HTML in your web page is correct or valid, use the official W3C Markup Validation Service as follows.

  1. Go to this web page: https://validator.w3.org.
  2. Click the Validate by Direct Input tab. Tutorial RWD: Media Queries
  3. Select your entire HTML file (both <head> and <body>), and copy-and-paste it into the box named Enter the Markup to validate. Tutorial RWD: Media Queries
  4. Click the Check button.
  5. If you see any errors, return to your base-8.html file in your text editor, fix the errors, save the file, and copy-and-paste the entire file again.  In the HTML Validator, click the Back button of your web browser to again display the Validate by Direct Input tab. Click once in the tab and paste in your corrected HTML file. Your new, pasted-in file will replace the earlier version. Finally, click the Check button.

Validating your stylesheet

To check your CSS is correct, use the official W3C CSS Validation Service. Follow these steps.

  1. Go to this web page: https://jigsaw.w3.org/css-validator.
  2. Click the By direct input tab. Tutorial RWD: Media Queries
  3. Copy and paste your CSS file into the box named Enter the CSS you would like validated.
  4. Click the Check button.
  5. If you see any errors (other than those related to the fluid typographic equation, as shown below), return to your base-8.css file in your text editor, fix the errors, save the file, and copy the entire file again. Tutorial RWD: Media Queries
  6. In the CSS Validator, click the Back button of your web browser to again display the By direct input tab. Click once in the tab and paste in your corrected CSS file. Your new, pasted-in file will replace the earlier version. Finally, click the Check button.

Uploading your two files to GitHub

After validating your web page and stylesheet, you are now ready to upload them to your account on GitHub.

  1. Sign in to your account at GitHub.com. At the left of the screen, you can see a list of your repositories. Upload to GitHub
  2. On your GitHub home page, click the name of the repository that holds your web pages. Its name will look as follows, where username is your chosen username on GitHub.   username.github.io   GitHub Upload
  3. On the next screen displayed, near the centre of the screen, click the Upload files button. Project Animation Google Fonts
  4. Select or drag-and-drop the two files base-8.html and base-8.css to upload them to your GitHub account. Project Animation Google Fonts
  5. After uploading your files, scroll down to the bottom of the screen, enter a short message in the Commit changes box and click the Commit changes button.

Your 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/base-8.html

It may take a few minutes for your uploaded file to appear on GitHub.

Further resources

HTML links
From W3 Schools

Links and Images
From Interneting is Hard

Creating hyperlinks
From the Mozilla Developer Network

HTML anchors and links
From HTML.com

Video: How to create links in HTML
By Multimedia Tutorials

Video: Linking your web pages together
By Gaute Michel Ferstad


Return to All Tutorials.