HTML stands for Hyper Text Markup Language. It is the standard markup language used by developers to create web pages. It is a simple, useful way to structure content. HTML is typically used together with JavaScript and Cascading Style Sheets (CSS). These three technologies are the cornerstone of web development. This HTML beginner tutorial will introduce you to a few basic concepts, including tags, attributes and elements.

Getting started with HTML

HTML files are simple text files. To write your first code in HTML, all you need is a text editor, like Notepad++ or Wordpad.

To create a basic HTML page, you need to follow these steps:

Open a text editor and type a few words, for example “My first web page”.

Create a folder named “html”.

Save the file to this folder as a plain text file with html extension, for example “myfirstwebpage.html”.

Be sure to save the file as plain text, not rich text.

Be sure to use the “.html” extension, as some text editors will automatically save the file as “.txt” otherwise.

To view the HTML file, open your web browser and type the location of the file you just saved into the address bar. For example,“c:\html\myfirstpage.html”. Then press Enter. (You can also go to the File menu of the browser, select Open, and browse for the file you saved.)

You will now be able to view the file as a web page.

The next stage of our HTML beginner tutorial will look at how to start adding structure to your web page, using tags.

HTML tags

A tag is a piece of code that helps to define the basic structure of your HTML document. Tags will surround the content in your document, and apply specific meaning to that content. For example, do you want to define a document, a heading, a sub-heading or a paragraph? You’ll use tags to show these definitions.

An opening tag between these symbols: < >

A closing tag appears between these symbols </ >

Tags can be used to define a few words of content, a few lines, a few paragraphs, or even an entire document.

Tags in action

To start off with a few simple tags, add this text to your document, before and after your first line of copy:

The <!DOCTYPE html> tag is a document type declaration, which tells the browser which type of HTML you’re using. HTML5 is the most updated version.

The <html> tag tells the browser that everything between that opening tag and </html> closing tag is an HTML document. You need to ensure that there is an opening tag and a closing tag, to mark the beginning and end of the code.

The <head> and <title> tags define the title of your document. Title tags are required for all HTML documents, because they determine the title that appears in the browser toolbar, and in search engine results.

The <body> tag defines the main content of the document, which will appear in the browser window and will be coded between that opening tag and the </body> closing tag.

If you save the file and reload it in your web browser, you’ll see that the title “My first web page” now appears in the browser, and the main body “My web page content…” appears on the page.

Next, you can add headings and paragraphs to your document using tags.

Headings are defined using <h1> to <h6> tags, with <h1> being the most important heading and <h6 > being the least important.

Add a series of heading tags as shown below, between the <body> and </body> tags. Then save your document and refresh your page.

When you save and refresh, there will be a clickable link on your web page.

Images: HTML images are coded using the tag <img>, and the image source filename is specified using an attribute called the src attribute. Note that the image URL must be written inside quotation marks.

The image must be stored on an HTML page online – not on a local computer. Note that the <img src> tag doesn’t require a closing tag.

For example, you can add an image to your first paragraph using this code:

Dimensions: You can set the height and width of an image in HTML using size attributes. The dimensions are specified in pixels. Note that the pixel number must always be written inside quotation marks.

For example, you can resize the image in your first paragraph by using the following code:

HTML elements

When we talk about elements, we’re referring to the individual parts that make up a web page. Your HTML tags mark the beginning and end of each element.

For example, the content that appears between the <body> and </body> tags is the body element. And the text that appears between the “<title>” and “</title>” tags, “<title>My Page Title</title>” would be called the title element.

Part 2 of our HTML beginner tutorial will show you how to set up lists, links and images. In the meantime, if you’re interested in learning more about HTML code, check out our mentor-led online coding courses.