Beruflich Dokumente
Kultur Dokumente
2: HTML
What is HTML?
HTML is a markup language for
describing web documents (web pages).
</body>
</html>
HTML cont.
The <!DOCTYPE html> declaration
defines this document to be HTML5
<tagname>content goes
here...</tagname>
HTML Tags cont.
HTML tags normally come in pairs like
<p> and </p>
<!DOCTYPE html>
<!doctype HTML>
HTML Versions
Version Year
HTML 1991
HTML 2.0 1995
HTML 3.2 1997
HTML 4.01 1999
XHTML 2000
HTML5 2014
HTML Editors
Web pages can be created and
modified by using professional HTML
editors.
</body>
</html>
HTML Horizontal Rules
The <hr> tag defines a thematic
break in an HTML page, and is most
often displayed as a horizontal rule.
HTML Horizontal Rules
cont.
<!DOCTYPE html>
<html>
<body>
</body>
</html>
The HTML <head> Element
The HTML <head> element has nothing to
do with HTML headings.
</body>
</html>
HTML Paragraphs
The HTML <p> element defines a
paragraph
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
HTML Display
You cannot be sure how HTML will be displayed.
<p>
This paragraph
contains a lot of lines
in the source code,
but the browser
ignores it.
</p>
<p>
This paragraph
contains a lot of spaces
in the source code,
but the browser
ignores it.
</p>
<p>
The number of lines in a paragraph depends on the size of the browser window.
If you resize the browser window, the number of lines in this paragraph will change.
</p>
</body>
HTML Line Breaks
The HTML <br> element defines a
line break.
</body>
</html>
The Poem Problem
<!DOCTYPE html>
<html>
<body>
<p>
</p>
</body>
</html>
The Poem Problem cont.
The HTML <pre> Element
<pre>
My Bonnie lies over the ocean.
</body>
</html>
The HTML Style Attribute
Setting the style of an HTML element,
can be done with the style attribute.
<tagname style="property:value;">
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
HTML Text Color
The color property defines the text
color for an HTML element
HTML Text Color cont.
<!DOCTYPE html>
<html>
<body>
</body>
</html>
HTML Fonts
The font-family property defines the
font to be used for an HTML element
HTML Fonts cont.
<!DOCTYPE html>
<html>
<body>
<h1 style="font-family:verdana;">This is a
heading</h1>
<p style="font-family:courier;">This is a
paragraph.</p>
</body>
</html>
HTML Text Size
The font-size property defines the
text size for an HTML element
HTML Text Size cont.
<!DOCTYPE html>
<html>
<body>
<h1 style="font-size:300%;">This is a
heading</h1>
<p style="font-size:160%;">This is a
paragraph.</p>
</body>
</html>
HTML Text Alignment
The text-align property defines the
horizontal text alignment for an
HTML element
HTML Text Alignment cont.
<!DOCTYPE html>
<html>
<body>
<h1 style="text-align:center;">Centered
Heading</h1>
<p style="text-align:center;">Centered
paragraph.</p>
</body>
</html>
HTML Formatting Elements
<b> - Bold text
<strong> - Important text
<i> - Italic text
<em> - Emphasized text
<mark> - Marked text
<small> - Small text
<del> - Deleted text
<ins> - Inserted text
<sub> - Subscript text
<sup> - Superscript text
HTML <b> and <strong>
Elements
The HTML <b> element defines bold text, without any extra
importance
<!DOCTYPE html>
<html>
<body>
</body>
</html>
HTML <i> and <em> Elements
The HTML <i> element defines italic text, without any extra
importance.
<!DOCTYPE html>
<html>
<body>
</body>
</html>
HTML <small> Element
The HTML <small> element defines smaller text
<!DOCTYPE html>
<html>
<body>
</body>
</html>
HTML <mark> Element
The HTML <mark> element defines marked or
highlighted text
<!DOCTYPE html>
<html>
<body>
</body>
</html>
HTML <del> Element
The HTML <del> element defines deleted (removed) text
<!DOCTYPE html>
<html>
<body>
</body>
</html>
HTML <ins> Element
The HTML <ins> element defines inserted (added) text
<!DOCTYPE html>
<html>
<body>
</body>
</html>
HTML <sub> Element
The HTML <sub> element defines subscripted text
<!DOCTYPE html>
<html>
<body>
</body>
</html>
HTML <sup> Element
The HTML <sup> element defines superscripted text
<!DOCTYPE html>
<html>
<body>
<p>This is <sup>superscripted</sup>
text.</p>
</body>
</html>
HTML Comment Tags
You can add comments to your HTML
source by using the following syntax