Minimal Page
This is the minimal page we will use. It contains no content inside the the body element:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title></title> </head> <body> </body> </html>
It has everything that a browser needs to create a web page. It defines the
DOCTYPE, the language, the
header, and the body or content section of the page. Any information that the
browser will use to create the page will be between <
and
>
. These are called
angle brackets. Angle
brackets are used to enclose
tags, which look like this:
<tag-type></tag-type>
Elements
Most tags will occur in pairs, with an open tag and a close
tag. Open and close tags are alike except that the close tag starts with
</
instead of just <
. The open and close tags together
with the content between them form an
HTML element.
Attributes
Additional information can be given about an HTML element using
attributes.
Attributes are assigned (or bound to) values using the
assignment operator (=
). The value is enclosed in
quotation marks (""). The general syntax looks like this:
Attributes are put inside the open tag of an element, after the tag name. One element can have several attributes, seperated by spaces.
We have already seen two examples of attributes in the minimal page:
lang="en"
in the html element and charset="utf-8"
in the meta element.
Comments
Comments contain information for the webmaster to see, but not for the viewer of the web page (the browser does not render them). They can also be used to make the browser temporarily ignore parts of a page (this is called commenting out) that contain errors.
If you want to create a comment use:
<!-- put your comment here -->
We will add comments to our minimal page indicating where to add content.