Beruflich Dokumente
Kultur Dokumente
INTRODUCTION
What is HTML?
HTML is the standard markup language for creating Web pages.
1
</body>
</html>
Example Explained
The <!DOCTYPE html> declaration defines this document to be
HTML5.
HTML Tags
HTML tags are element names surrounded by angle brackets.
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 inserted before the tag name.
The start tag is also called the opening tag, and the end tag
the closing tag.
Web Browsers
The purpose of a web browser (Chrome, IE, Firefox, Safari) is to
read HTML documents and display them.
2
The browser does not display the HTML tags, but uses
them to determine how to display the document.
3
The <!DOCTYPE> Declaration
The <!DOCTYPE> declaration represents the document type,
and helps browsers to display web pages correctly.
It must only appear once, at the top of the page (before any
HTML tags).
<!DOCTYPE html>
4
HTML Editors
Write HTML Using Notepad or TextEdit
Web pages can be created and modified by using professional HTML editors.
However, for learning HTML we recommend a simple text editor like Notepad
(PC) or TextEdit (Mac).
Follow the four steps below to create your first web page with Notepad or
TextEdit.
Open the Start Screen (the window symbol at the bottom left on your
screen). Type Notepad.
Windows 7 or earlier:
Then under "Open and Save", check the box that says "Ignore rich text
commands in HTML files".
5
Then open a new document to place the code.
</body>
</html>
6
You can use either .htm or .html as file extension. There is no
difference, it is up to you.
7
HTML BASICS
HTML Documents
All HTML documents must start with a document type
declaration: <!DOCTYPE html>.
HTML Headings
HTML headings are defined with the <h1> to <h6> tags.
Example :-
<h1>This is heading 1</h1>
<h2>This is heading 2</h2>
<h3>This is heading 3</h3>
HTML Paragraphs
8
HTML paragraphs are defined with the <p> tag.
Example :-
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
HTML Links
HTML links are defined with the <a> tag.
Example :-
<a href="https://www.google.com">This is a
link</a>
The link's destination is specified in the href attribute.
HTML Images
HTML images are defined with the <img> tag.
The source file (src), alternative text (alt), width, and height are
provided as attributes.
Example :-
<img src="google.jpg" alt="W3Schools.com" width="104" height
="142">
9
HTML ELEMENTS
HTML ELEMENTS
An HTML element usually consists of a start tag and end tag,
with the content inserted in between.
The HTML element is everything from the start tag to the end
tag.
10
<p> My first paragraph. </p>
<br>
Example :-
<!DOCTYPE html>
<html>
<body>
</body>
</html>
Example Explained :
(1) The <html> element defines the whole document.
11
It has a start tag <body> and an end tag </body>.
The element content is two other HTML elements (<h1> and <p>).
Example
<html>
<body>
<p>This is a paragraph
<p>This is a paragraph
</body>
</html>
12
Empty elements can be "closed" in the opening tag like
this: <br />.
HTML TAGS
Some HTML Tags are explained below :-
1) <!DOCTYPE>
The <!DOCTYPE> declaration must be the very first thing in
your HTML document, before the <html> tag.
13
The <!DOCTYPE> declaration is not an HTML tag; it is an
instruction to the web browser about what version of HTML the
page is written in.
2) <html> Tag
The <html> tag tells the browser that this is an HTML
document.
The <html> tag is the container for all other HTML elements
(except for the <!DOCTYPE> tag).
3) <head> Tag
The <head> element is a container for all the head elements.
<style>
<base>
14
<link>
<meta>
<script>
<noscript>
4) <title> Tag
The <title> tag is required in all HTML documents and
it defines the title of the document.
5) <body> Tag
The <body> tag defines the document's body.
15
6) <h1> to <h6> Tags
The <h1> to <h6> tags are used to define HTML headings.
Example:-
The six different HTML headings:
7) <p> Tag
The <p> tag defines a paragraph.
Example :-
A paragraph is marked up as follows:
<p>This is some text in a paragraph.</p>
16
17
18