HTML
HTML
HTML
There are some HTML elements that don't have a closing tag or any contents. These
are called void elements. Void elements
include <img> , <meta> , <link> and <input> .
Element names can be thought of as descriptive keywords for the content they
contain, such as video , audio , table , footer .
A HTML page may consist of potentially hundreds of elements which are then read
by a web browser, interpreted and rendered into human readable or audible content
on the screen.
For this document it is important to note the difference between elements and tags:
Element insight#
Let's break down a tag...
Elements commonly have an opening tag and a closing tag. The opening tag
contains the element's name in angle brackets ( <p> ). The closing tag is identical to
the opening tag with the addition of a forward slash ( / ) between the opening bracket
and the element's name ( </p> ).
Content can then go between these two tags: <p>This is a simple paragraph.</p> .
HTML files can be created using any text editor. The files must be saved with
a .html or .htm [2] extension in order to be recognized as HTML files.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Hello!</title>
</head>
<body>
<h1>Hello World!</h1>
<p>This is a simple paragraph.</p>
</body>
</html>
Tag Meaning
<!DOCTYPE> Defines the HTML version used in the document. In this case it is HTML5.
See the doctypes topic for more information.
<html> Opens the page. No markup should come after the closing tag ( </html> ). The lang at
declares the primary language of the page using the ISO language codes ( en for Engl
See the Content Language topic for more information.
Tag Meaning
<head> Opens the head section, which does not appear in the main browser window but mainl
information about the HTML document, called metadata. It can also contain imports fro
stylesheets and scripts. The closing tag is </head> .
<meta> Gives the browser some metadata about the document. The charset attribute declare
the character encoding. Modern HTML documents should always use UTF-8, even tho
a requirement. In HTML, the <meta> tag does not require a closing tag.
See the Meta topic for more information.
<title> The title of the page. Text written between this opening and the closing tag ( </title> )
displayed on the tab of the page or in the title bar of the browser.
<body> Opens the part of the document displayed to users, i.e. all the visible or audible conten
No content should be added after the closing tag </body> .
<h1> A level 1 heading for the page.
See headings for more information.
<p> Represents a common paragraph of text.