Professional Business Website · Project

Professional Business Website · Foundation · Path B

Your First HTML Page in Visual Studio Code

Write a complete HTML page by hand, open it in the browser, and learn the editor features you will use every day in the project.

What you need

A computer (Windows, macOS or Linux) with Visual Studio Code (free) and a current web browser such as Chrome or Firefox. A smartphone is used for testing.

In this lesson you will

  • Write a valid HTML document skeleton
  • Use Visual Studio Code to create, save and preview files

Key concepts

doctypeheadbodyelementattributesave and refresh

The lesson

Every HTML page starts with the same skeleton: a doctype, an html element with a lang attribute, a head with the character set, viewport and title, and a body with the visible content.

The viewport meta tag tells phones to use their real screen width; without it, mobile browsers show a tiny zoomed-out desktop page. It is one of the most important lines for a mobile-first site.

Work in a loop: edit in Visual Studio Code, save (Ctrl+S), refresh the browser. Use the editor's auto-indentation and the Explorer panel to keep files tidy.

Step by step

  1. In amani-website, open index.html in Visual Studio Code.
  2. Type the HTML skeleton with lang="en", charset UTF-8, the viewport tag and a title.
  3. Add an h1 with the business name and a paragraph describing the shop.
  4. Save, open the file in the browser and check the result on a narrow window.

Practice activity

Create index.html with a correct skeleton, a heading, a paragraph and an image with alternative text, and validate it with the W3C validator.

Expected result: A page that displays in the browser and passes the W3C validator with no errors.

Common mistakes

  • Forgetting to save before refreshing the browser
  • Leaving out the viewport meta tag, so the page looks tiny on phones

Check your understanding

  1. What does the viewport meta tag do?

    Show answer

    Makes phones use their real screen width instead of a zoomed-out desktop view.

  2. What three actions make up the basic editing loop?

    Show answer

    Edit the file, save it, refresh the browser.

Further learning

Projects are instructor-guided: an instructor sets milestones, checks your work and gives feedback, online or in person. Self-study of the public lessons does not lead to a certificate. Enrolment and fees follow the Academy's existing policies — contact the Academy.