About-HTML
About-HTML
part 1
Prepared by: Mr. Bernie S. Acdal
What is HTML?
• HTML stands for Hyper Text Markup Language
• HTML is the standard markup language for creating Web
pages
• HTML describes the structure of a Web page
• HTML consists of a series of elements
• HTML elements tell the browser how to display the content
• HTML elements label pieces of content such as "this is a
heading", "this is a paragraph", "this is a link", etc.
Example Explained
•The <!DOCTYPE html> declaration defines that this
document is an HTML5 document
•The <html> element is the root element of an HTML
page
•The <head> element contains meta information about
the HTML page
•The <title> element specifies a title for the HTML page
(which is shown in the browser's title bar or in the page's
tab)
•The <body> element defines the document's body, and
is a container for all the visible contents, such as
headings, paragraphs, images, hyperlinks, tables, lists,
etc.
•The <h1> element defines a large heading
•The <p> element defines a paragraph
What is an HTML Element?
• An HTML element is defined by a start tag, some content,
and an end tag:
• <tagname>Content goes here...</tagname>
• The HTML element is everything from the start tag to the
end tag:
• <h1>My First Heading</h1>
• <p>My first
Start tag paragraph.</p>
Element content End tag
<h1> My First Heading </h1>
<p> My first paragraph. </p>
<br> none none
Web Browsers
• The purpose of a web browser (Chrome, Edge, Firefox,
Safari) is to read HTML documents and display them
correctly.
• A browser does not display the HTML tags, but uses them
to determine how to display the document:
HTML History
Since the early days of the World
Wide Web, there have been many
versions of HTML:
Year Version
1989 Tim Berners-Lee invented www
1991 Tim Berners-Lee invented HTML
1993 Dave Raggett drafted HTML+
1995 HTML Working Group defined HTML
2.0
1997 W3C Recommendation: HTML 3.2
1999 W3C Recommendation: HTML 4.01
2000 W3C Recommendation: XHTML 1.0
2008 WHATWG HTML5 First Public Draft
2012 WHATWG HTML5 Living Standard
2014 W3C Recommendation: HTML5
2016 W3C Candidate Recommendation:
HTML 5.1
2017 W3C Recommendation: HTML5.1 2n
d Edition
HTML Basic Examples
HTML Documents
All HTML documents must start with a document type
declaration: <!DOCTYPE html>.
The HTML document itself begins with <html> and ends
with </html>.
The visible part of the HTML document is
between <body> and </body>.
HTML Headings
HTML headings are defined with
the <h1> to <h6> tags.
<h1> defines the most important
heading. <h6> defines the least important heading:
<!DOCTYPE html>
<html>
<body> OUTPU This is a paragraph.
T
This is another paragraph.
<p>This is a paragraph.</p>
<p>This is another
paragraph.</p>
</body>
</html>
HTML Links
HTML links are defined with the <a> tag:
<h2>HTML Links</h2>
<p>HTML links are defined with the
a tag:</p> The link's destination is specified
in the href attribute.
<a
href="https://www.w3schools.com">T
Attributes are used to provide
his is a link</a> additional information about
HTML elements.
</body>
</html>
HTML Images
HTML images are defined with the <img> tag.
The source file (src), alternative text (alt), width,
and height are provided as attributes:
<!DOCTYPE html>
<html>
<body> OUTPU
T
<h2>HTML Images</h2>
<p>HTML images are defined with the
img tag:</p>
<img src="w3schools.jpg"
alt="W3Schools.com" width="104"
height="142">
</body>
</html>
HTML Attributes
• All HTML elements can have attributes
• Attributes provide additional information about
elements
• Attributes are always specified in the start tag
• Attributes usually come in name/value pairs
like: name="value"
The href Attribute
The <a> tag defines a hyperlink. The href attribute specifies
the URL of the page the link goes to:
Example:
<a href="https://www.w3schools.com">Visit W3Schools</a>
Tip: It is almost always best to use relative URLs. They will not break if you
change domain.
The Width and Height Attributes
The <img> tag should also contain the width and height attributes,
which specifies the width and height of the image (in pixels):
Example:
<img src="img_girl.jpg" width=“100" height=“100">
</body>
</html>
The lang Attribute
You should always include the lang attribute inside the <html> tag, to
declare the language of the Web page. This is meant to assist search
engines and browsers.
The following example specifies English as the language:
Example:
<!-- Write your comments here -->
HTML Links - Hyperlinks
HTML links are hyperlinks.
You can click on a link and jump to another document.
When you move the mouse over a link, the mouse arrow will turn
into a little hand.
Note: A link does not have to be text. A link can be an image or
any other HTML element!
Table Rows
Each table row starts with a <tr> and end with a </tr> tag.
tr stands for table row.
<!DOCTYPE html>
<html>
<style>
table, th, td {
border:1px solid black;
}
</style>
<body>
<table style="width:100%">
<tr>
<td>Emil</td> OUTPU
<td>Tobias</td> T
<td>Linus</td>
</tr>
<tr>
<td>16</td>
<td>14</td>
<td>10</td>
</tr>
</table>
</body>
</html>
End of HTML part 1