Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
HYPERTEXT MARKUP
LANGUAGE
OUTLINE
INTRODUCTION
HTML BASICS
HTML ATTRIBUTES
HTML TEXT FORMATTING
HTML STYLE ATTRIBUTE
INTRODUCTION
HTML stands for HyperText Markup Language, it is
the authoring language used to create documents on
the World Wide Web.
HTML is used to define the structure and layout of a
Web page, how a page looks and any special
functions. HTML does this by using what are called
<h1>My First
Heading</h1>
<p>My first
paragraph.</p>
</body>
</html>
HTML EDITORS
HTML can be edited by using
professional HTML editors like
Adobe Dreamweaver
Microsoft WebMatrix
Sublime Text
Microsoft Notepad
HTML BASICS
HTML TAGS
HTML tags are keywords (tag names) surrounded
by angle brackets:
<tagname>content</tagname>
HTML tags normally come in pairs like <p> and </p>
The first tag in a pair is the start tag, the second tag
is the end tag
The end tag is written like the start tag, but with
a forward slash before the tag name
<!DOCTYPE html>
HTML DOCUMENTS <html>
All HTML documents must start <body>
with a type declaration:
<!DOCTYPE html> <h1>My First
Heading</h1>
The HTML document itself
begins with <html> and ends
<p>My first
with </html>
paragraph.</p>
The visible part of the HTML
document is between </body>
<body> and </body> </html>
THE HTML <head>
ELEMENT
The <head> element is a
container for metadata (data
<!DOCTYPE html>
<html>
about data). <head>
HTML metadata is data about <title>My First Web
the HTML document. Metadata Page</title>
is not displayed. </head>
Metadata typically define <body>
document title, styles, links, Hello Class!!!
scripts, and other meta </body>
information. </html>
The following tags describe
metadata: <title>, <style>,
<meta>, <link>, <script>, and
<base>.
HTML HEADINGS
HTML headings <h1>This is a
heading</h1>
are defined with <h2>This is a
the <h1> to <h heading</h2>
6> tags <h3>This is a
heading</h3>
<h4>This is a
heading</h4>
HTML PARAGRAPHS
HTML paragraphs are defined with
the <p> tag
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
HTML <br> TAG
The <br> tag inserts a single line
break.
The <br> tag is an empty tag which
means that it has no end tag
This text contains<br>a line
break.
HTML LINKS
HTML links are defined with the <a> tag
<a href="https://www.google.com.pk/?
gws_rd=cr,ssl&ei=izeVVp7fFcGqsAHr4LqoAw">Google</a>
<p>This is a paragraph.</p>
HTML ELEMENTS
HTML elements are written with a start tag, with an end tag, with
the content in between:
<tagname>content</tagname>
The HTML element is everything from the start tag to the end tag
<img src=“imagei.gif" alt=“Tim Berners-
Lee" width="150" height="150">
SINGLE OR DOUBLE
QUOTES?
Double style quotes are the most common in HTML,
but single style can also be used.
In some situations, when the attribute value itself
contains double quotes, it is necessary to use single
quotes
<p title='John "ShotGun" Nelson'>
<h1>HTML <small>Small</small> Formatting
</h1>
MARKE
HTML
DFORMATTING
The HTML <mark> element
defines marked or highlighted text
<h1>HTML <mark>Marked</mark> Formatting</h1>
HTML SUBSCRIPT FORMAT
TING
The HTML <sub> element
defines subscripted text
<p>H<sub>2</sub>O</p>
HTML SUPERSCRIPT
FORMAT
TING
The HTML <sup> element
defines superscripted text
<p>x<sup>2</sup></p>
HTML STYLE
ATTRIBUTE
HTML STYLE
ATTRIBUTE
Setting the style of an HTML element, can
be done with the style attribute.
The HTML style attribute has the
following syntax:
style="property:value;"
HTML BACKGROUND
COLOR
The background-color property defines
the background color for an HTML element
<body style="background-
color:lightgrey;">
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
HTML TEXT COLOR
The color property defines the
text color for an HTML element
<h1 style="color:blue;">This is a
heading</h1>
<p style="color:red;">This is a
paragraph.</p>
HTML FONTS
The font-family property defines the
font to be used for an HTML element
• <h1 style="font-family:verdana;">This is a
heading</h1>
<p style="font-family:courier;">This is a
paragraph.</p>
HTML TEXT SIZE
The font-size property defines
the text size for an HTML element
<h1 style="font-size:300%;">This is a
heading</h1>
<p style="font-size:160%;">This is a
paragraph.</p>
HTML TEXT
ALIGNMENT
The text-align property defines the
horizontal text alignment for an HTML
element
<h1 style="text-align:center;">Centered
Heading</h1>
<p>This is a paragraph.</p>
left, center and right
THE END