Yahxee 1st Class
Yahxee 1st Class
The first tag in a pair is the start tag/opening tags, the second tag is
the end tag/closing tags
HTML element is everything between the start tag and the end tag,
including the tags
The text between the start and end tags is the element content
HTML tags are not case sensitive, <b> means the same as <B>
HTML Elements
Example of HTML Element:
<tagname>content</tagname>
<head>
<title>MY FIRST WEB PAGE</title>
</head>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>
Steps to create first web page with
Notepad
Step 3: Save Your HTML
Select Save as.. in Notepad's file menu.
When you save an HTML file, you can use either
the .htm or the .html file extension.
There is no difference, it is entirely up to you.
Step 4: Run the HTML in Your Browser
Start your web browser and open your html file
from the File,Open menu, or just browse the
folder and double-click your HTML file.
HTML Document
• The HTML document is divided into two major
parts: Structure
• HEAD: contains information about the
document:
• Title of the page (which appears at the top of the
browser window)
• Meta tags: used to describe the content (used by
Search engines)
• JavaScript and Style sheets generally require
statements in the document Head
<body>
<h1>This a Heading</h1>
<p>This is a paragraph.</p>
</body>
< / html>
Example
Explained
The <!DOCTYPE> Declaration
There are many different documents on the
web.
a browser can only display an HTML page
100% correctly if it knows the HTML type and
version used.
The <!DOCTYPE> declaration helps the
browser to display a web page correctly.
Common Declarations
HTML5
< !DOCTYPE html>
Example
Explained
The second tag in your HTML document is <html>. This
tag tells your browser that this is the start of an HTML
document. The last tag in your document is </html>.
This tag tells your browser that this is the end of the
HTML document.
The text between the <head> tag and the </head>
tag is header information. Header information is not
displayed in the browser window.
The text between the <title> tags is the title of your
document. The title is displayed in your browser's
caption.
The text between the <body> tags is the text that will
be displayed in your browser.
The text between the <h1> and </h1> tags will be
displayed as the headline of your web page.
Nested
Tags/Element
Nested HTML Elements
• HTML documents consist of nested HTML elements.
• Most HTML elements can be nested (can contain other HTML elements).
• When you enclose an element in with multiple tags, the last tag opened
should be the first tag closed.
For example:
<p><b><em>This is NOT the proper way to close nested
tags.</p></em></b>
<p><b><em>This is the proper way to close nested tags. </em></b></p>