At the end of this Tutorial you will be able to:
You can view a finished version of this exercise by clicking the image below.
Let’s create a new web page – that is, an HTML file. Here are the steps:
Let’s edit the ‘standard’ text in the <head> that was created by Visual Studio.
<title>Sample web page with default styling</title>
<meta name="description" content="A sample web page without a linked stylesheet file.">
<meta name="author" content="Mary Smith">
<!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-NNNNNNN-1"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-NNNNNNN-1'); </script>
The <head> of your HTML file should now look as shown below.
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>Sample web page with default styling</title> <meta name="description" content="A sample web page without a linked stylesheet file."> <meta name="author" content="Mary Smith"> <!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-NNNNNNN-1"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-NNNNNNN-1'); </script> </head>
Save your web page.
If you are using Sublime Text rather than Microsoft Visual Studio Code, follow these steps to create a new HTML file.
Let’s display your base-0.html web page in a web browser.
In this section, you will copy-and-paste some text content to the <body> of your web page.
Heading 1
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut in ipsum at risus feugiat facilisis at et orci.
Heading 2
Donec ut leo eget risus mattis mattis non vitae massa. Suspendisse potenti. Aenean efficitur fermentum orci ac blandit. Quisque tempus tincidunt metus at interdum. Aenean elementum vehicula tellus id gravida. Aenean mollis sollicitudin elit.
Morbi eu ipsum sed nunc porta posuere. Donec et mi accumsan, eleifend augue ac, pellentesque risus. Maecenas in egestas dolor, vitae consequat dui.
Heading 3
Ut quis rhoncus lorem. Duis mauris arcu, luctus et velit eu, luctus rutrum magna. Morbi volutpat bibendum libero sed pellentesque. Maecenas eu scelerisque mauris. Morbi eu ipsum sed nunc porta posuere. Donec et mi accumsan, eleifend augue ac, pellentesque risus.
Heading 3
Pellentesque non dignissim tellus. Suspendisse potenti. Ut convallis euismod quam non luctus. Etiam vel sapien at sem elementum tempor eget at dolor. Integer et fringilla dolor. Duis velit turpis, faucibus id lorem a, eleifend pellentesque nisi.
Nunc rhoncus, massa in scelerisque lacinia, nulla justo porta eros, vel pulvinar mauris ligula vitae dui. Quisque massa nibh, venenatis sed tortor ut, tincidunt imperdiet sapien. Ut vehicula sit amet orci non sollicitudin.
Now you will mark-up the text of your web page with the following HTML tags: <h1>, <h2>, <h3> and <p>.
<body> <h1>Heading 1</h1> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut in ipsum at risus feugiat facilisis at et orci.</p> <h2>Heading 2</h2> <p>Donec ut leo eget risus mattis mattis non vitae massa. Suspendisse potenti. Aenean efficitur fermentum orci ac blandit. Quisque tempus tincidunt metus at interdum. Aenean elementum vehicula tellus id gravida. Aenean mollis sollicitudin elit.</p> <p>Morbi eu ipsum sed nunc porta posuere. Donec et mi accumsan, eleifend augue ac, pellentesque risus. Maecenas in egestas dolor, vitae consequat dui.</p> <h3>Heading 3</h3> <p>Ut quis rhoncus lorem. Duis mauris arcu, luctus et velit eu, luctus rutrum magna. Morbi volutpat bibendum libero sed pellentesque. Maecenas eu scelerisque mauris. Morbi eu ipsum sed nunc porta posuere. Donec et mi accumsan, eleifend augue ac, pellentesque risus.</p> <h3>Heading 3</h3> <p>Pellentesque non dignissim tellus. Suspendisse potenti. Ut convallis euismod quam non luctus. Etiam vel sapien at sem elementum tempor eget at dolor. Integer et fringilla dolor. Duis velit turpis, faucibus id lorem a, eleifend pellentesque nisi.</p> <p>Nunc rhoncus, massa in scelerisque lacinia, nulla justo porta eros, vel pulvinar mauris ligula vitae dui. Quisque massa nibh, venenatis sed tortor ut, tincidunt imperdiet sapien. Ut vehicula sit amet orci non sollicitudin.</p> </body>
Google and other search engines use software programs called spiders to crawl the web for web pages to add to their list of indexed web pages. Only web pages listed in such an index will appear in search engine results.
If you don't want a particular web page to be found by Google or other search engines, follow these steps:
<meta name="robots" content="noindex">You can add this anywhere within the head. Typically, it is placed just after the charset line, as shown below.
Before you validate your web page and upload it to GitHub, ensure the following details are correct within the <head> of your base-0.html file.
To check the HTML in your web page is correct or valid, use the official W3C Markup Validation Service as follows.
After validating your web page, you are now ready to upload it to your account on GitHub.
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-0.html
It may take a few minutes for your uploaded file to appear on GitHub.
Basic web pages
From Interneting is Hard
HTML introduction – anatomy of a web page
By John Espirian at the John Espirian Blog
Tutorial: HTML for absolute beginners
By Luke Fabish at the Luke Fabish Blog
Return to Contents.