Itec106 01 HTML
Itec106 01 HTML
ITEC 106
What is HTML
• Hyper Text Markup Language
• Created by Tim Berners-Lee, Robert Cailliau, and others starting in 1989
• Hypertext means the document contains links that allow the reader to
jump to other places in the document or to another document
altogether
• Latest version is known HTML5
• A Markup Language is a way that computers speak to each other to
control how text is processed and presented. To do this HTML uses two
things: tags and attributes.
What are HTML tags?
• Tags are used to mark up the start of an HTML element and they are
usually enclosed in angle <> brackets. An example of a tag is: <h1>.
• Most tags must be opened <h1> and closed </h1> in order to
function.
What are HTML attributes?
• Attributes contain additional pieces of information. Attributes take
the form of an opening tag and additional info is placed inside.
• An example of an attribute is: <img src="mydog.jpg" alt="A photo of
my dog.">
• In this instance, the image source (src) and the alt text (alt) are
attributes of the <img> tag.
Golden Rules To Remember
1. The vast majority of tags must be opened (<tag>) and closed
(</tag>) with the element information such as a title or text resting
between the tags.
2. When using multiple tags, the tags must be closed in the order in
which they were opened. For example:
<strong><em>This is really important!</em></strong>
Basic Construction of an HTML Page
These tags should be placed underneath each other at the top of every
HTML page that you create.
• <!DOCTYPE html> — This tag specifies the language you will write on
the page. In this case, the language is HTML 5.
• <html> — This tag signals that from here on we are going to write in
HTML code.
• <head> — This is where all the metadata for the page goes — stuff
mostly meant for search engines and other computer programs.
• <body> — This is where the content of the page goes.
Further Tags
Inside the <head> tag, there is one tag that is always included: <title>,
but there are others that are just as important:
<title>
• This is where we insert the page name as it will appear at the top of
the browser window or tab.
<meta>
• This is where information about the document is stored: character
encoding, name (page context), description.
Other elements
• We also have a number of
other elements we can use
to control the text or make
it appear in a certain way.
The Anchor tag
• The <a> (or anchor) opening tag is written in the format:
<a href="https://blogging.com/how-to-start-a-blog/">Your Link Text Here </a>
• href = Hypertext REFerence
• The first part of the attribute points to the page that will open once the link is
clicked.
• Meanwhile, the second part of the attribute contains the text which will be
displayed to a visitor in order to entice them to click on that link.
• If you are building your own website then you will most likely host all of your
pages on professional web hosting. In this case, internal links on your website
will <a href=”mylinkedpage.html”>Linktle Here</a>.
The Image tag
• The <img> tag normally is written as follows:
<img src="yourimage.jpg" alt="Describe the image" height="X"
width="X">