Beruflich Dokumente
Kultur Dokumente
HTML Example
<!DOCTYPE html>
<html>
<body>
</body>
</html>
Example Explained
The DOCTYPE declaration defines the document type
The text between <html> and </html> describes the web page
The text between <body> and </body> is the visible page content
The text between <h1> and </h1> is displayed as a heading
The text between <p> and </p> is displayed as a paragraph
What is HTML?
HTML is a language for describing web pages.
HTML stands for Hyper Text Markup Language
HTML is a markup language
A markup language is a set of markup tags
The tags describe document content
HTML documents contain HTML tags and plain text
HTML documents are also called web pages
HTML Tags
HTML markup tags are usually called HTML tags
HTML tags are keywords (tag names) surrounded by angle brackets like <html>
HTML tags normally come in pairs like <b> and </b>
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, with a forward slash before the tag name
HTML Page 1
The end tag is written like the start tag, with a forward slash before the tag name
Start and end tags are also called opening tags and closing tags
HTML Elements
"HTML tags" and "HTML elements" are often used to describe the same thing.
But strictly speaking, an HTML element is everything between the start tag and the end tag, including the tags:
HTML Element:
<p>This is a paragraph.</p>
Web Browsers
The purpose of a web browser (such as Google Chrome, Internet Explorer, Firefox, Safari) is to read HTML documents and
display them as web pages.
The browser does not display the HTML tags, but uses the tags to determine how the content of the HTML page is to be
presented/displayed to the user:
HTML Versions
Since the early days of the web, there have been many versions of HTML:
Version Year
HTML 1991
HTML+ 1993
HTML 2.0 1995
HTML 3.2 1997
HTML 4.01 1999
XHTML 1.0 2000
HTML5 2012
XHTML5 2013
HTML Page 2
<!DOCTYPE> Declaration
09 January 2014 09:15
HTML Page 4
Guide to Strict HTML 4.01:
The <html> element: don’t leave home without it.
Always start each page with a DOCTYPE, but following that, the <html> element must
always be the top, or root, element of your Web page. So, after the DOCTYPE, the
<html> tag will start your page and the </html> tag should end it, with everything else in
your page nested inside.
Remember to use both your <head> and your <body> for better HTML.
Only the <head> and <body> elements can go directly inside your <html> element. This
means that every other element must go either inside the <head> or the <body>
element. No exceptions! Feed your <body> only wholesome block elements. You can
put only block elements (<h1>, <h2>, ..., <h6>, <p>, <blockquote>, and so on) directly
inside your <body> element. All inline elements and text need to be inside another
block element before they can go in the <body> element.
HTML Page 5
Remember the nesting problem:
So it looks like strict HTML 4.01 prefers that images, which are inline elements, be
nested inside a block element, like a paragraph or a heading.
HTML Page 6
HTML Basics
09 January 2014 09:15
HTML Elements
Empty HTML Elements
HTML elements with no content are called empty elements.
<br> is an empty element without a closing tag (the <br> tag defines a line break).
Tip: In XHTML, all elements must be closed. Adding a slash inside the start tag, like <br />, is the proper way of closing empty
elements in XHTML (and XML).
HTML Attributes
HTML elements can have attributes
Attributes provide additional information about an element
Attributes are always specified in the start tag
Attributes come in name/value pairs like: name="value"
<html>
Differences Between HTML 4.01 and HTML5
HTML5 has added a new attribute: manifest.
Attributes
New : New in HTML5.
Attribute Value Description
manifestN URL Specifies the address of the document's cache manifest (for offline browsing)
ew
xmlns http://www.w3.org/19 Not supported in HTML. Only for XHTML. Specifies the XML namespace attribute (If you
99/xhtml need your content to conform to XHTML)
<body>
Differences Between HTML 4.01 and HTML5
All layout attributes is removed from HTML5.
All layout attributes is deprecated in HTML 4.01.
HTML Page 7
<h1> to <h6> tags
Differences Between HTML 4.01 and HTML5
The "align" attribute is deprecated in HTML 4.01, and is not supported in HTML5. Use CSS to align elements.
<hr>:
All layout attributes are deprecated in HTML 4.01, and are not supported in HTML5. Use CSS to style the <hr> element instead.
HTML Link:
HTML Hyperlinks (Links)
The HTML <a> tag defines a hyperlink.
A hyperlink (or link) is a word, group of words, or image that you can click on to jump to another document.
When you move the cursor over a link in a Web page, the arrow will turn into a little hand.
The most important attribute of the <a> element is the href attribute, which indicates the link's destination.
By default, links will appear as follows in all browsers:
An unvisited link is underlined and blue
HTML Page 8
An unvisited link is underlined and blue
A visited link is underlined and purple
An active link is underlined and red
Example
An anchor with an id inside an HTML document:
<a id="tips">Useful Tips Section</a>
Create a link to the "Useful Tips Section" inside the same document:
<a href="#tips">Visit the Useful Tips Section</a>
Or, create a link to the "Useful Tips Section" from another page:
<a href="http://www.w3schools.com/html_links.htm#tips">
Visit the Useful Tips Section</a>
Attributes
New : New in HTML5.
Attribute Value Description
charset char_encodin Not supported in HTML5. Specifies the character-set of a linked document
g
coords coordinates Not supported in HTML5. Specifies the coordinates of a link
downloadNe filename Specifies the hyperlink target to be downloaded
w
href URL Specifies the URL of the page the link goes to
hreflang language_cod Specifies the language of the linked document
HTML Page 9
hreflang language_cod Specifies the language of the linked document
e
mediaNew media_query Specifies what media/device the linked document is optimized for
name section_name Not supported in HTML5. Use the id attribute instead. Specifies the name of an anchor
rel alternate Specifies the relationship between the current document and the linked document
author
bookmark
help
license
next
nofollow
noreferrer
prefetch
prev
search
tag
rev text Not supported in HTML5. Specifies the relationship between the linked document and the
current document
shape default Not supported in HTML5. Specifies the shape of a link
rect
circle
poly
target _blank Specifies where to open the linked document
_parent
_self
_top
framename
typeNew MIME_type Specifies the MIME type of the linked document
HTML <head>
<body>
The content of the document......
</body>
</html>
HTML Page 10
</html>
HTML Page 11
<meta> Defines metadata about an HTML document
<script> Defines a client-side script
<style> Defines style information for a document
Attributes: <meta>
New : New in HTML5.
Attribute Value Description
charsetNew character_set Specifies the character encoding for the HTML document
content text Gives the value associated with the http-equiv or name attribute
http-equiv content-type Provides an HTTP header for the information/value of the content attribute
default-style
refresh
name application- Specifies a name for the metadata
name
author
description
generator
keywords
scheme format/URI Not supported in HTML5. Specifies a scheme to be used to interpret the value of the content
attribute
Attributes
New : New in HTML5.
Attribute Value Description
media media_quer Specifies what media/device the media resource is optimized for
y
scopedNe scoped Specifies that the styles only apply to this element's parent element and that element's child
w elements
type text/css Specifies the MIME type of the style sheet
HTML Page 12
Tips and Notes
Note: If the "src" attribute is present, the <script> element must be empty.
Tip: Also look at the <noscript> element for users that have disabled scripts in their browser, or have a browser that doesn't
support client-side scripting.
Note: There are several ways an external script can be executed:
If async="async": The script is executed asynchronously with the rest of the page (the script will be executed while the
page continues the parsing)
If async is not present and defer="defer": The script is executed when the page has finished parsing
If neither async or defer is present: The script is fetched and executed immediately, before the browser continues parsing
the page
Attributes
New : New in HTML5.
Attribute Value Description
asyncNew async Specifies that the script is executed asynchronously (only for external scripts)
charset charset Specifies the character encoding used in an external script file
defer defer Specifies that the script is executed when the page has finished parsing (only for external scripts)
src URL Specifies the URL of an external script file
type MIME-type Specifies the MIME type of the script
xml:space preserve Not supported in HTML5. Specifies whether whitespace in code should be preserved
HTML Images
HTML Images - The <img> Tag and the Src Attribute
In HTML, images are defined with the <img> tag.
The <img> tag is empty, which means that it contains attributes only, and has no closing tag.
To display an image on a page, you need to use the src attribute. Src stands for "source". The value of the src attribute is the
URL of the image you want to display.
Syntax for defining an image:
<img src="url" alt="some_text">
The URL points to the location where the image is stored. An image named "boat.gif", located in the "images" directory on
"www.w3schools.com" has the URL: http://www.w3schools.com/images/boat.gif.
The browser displays the image where the <img> tag occurs in the document. If you put an image tag between two
paragraphs, the browser shows the first paragraph, then the image, and then the second paragraph.
HTML Page 13
The value of the alt attribute is an author-defined text:
<img src="smiley.gif" alt="Smiley face">
The alt attribute provides alternative information for an image if a user for some reason cannot view it (because of slow
connection, an error in the src attribute, or if the user uses a screen reader).
Use GIF for images with solid colors, logos, and geometric shapes.
○ Allows one background color to be set to “transparent” so that anything underneath the image will show through.
HTML Tables
HTML Table Tags
Tag Description
<table> Defines a table
<th> Defines a header cell in a table
<tr> Defines a row in a table
<td> Defines a cell in a table
<caption> Defines a table caption
<colgroup> Specifies a group of one or more columns in a table for formatting
<col> Specifies column properties for each column within a <colgroup> element
<thead> Groups the header content in a table
<tbody> Groups the body content in a table
<tfoot> Groups the footer content in a table
HTML Lists
HTML Page 14
<ol> Defines an ordered list
<ul> Defines an unordered list
<li> Defines a list item
<dl> Defines a description list
<dt> Defines a term/name in a description list
<dd> Defines a description of a term/name in a description list
HTML Page 15
HTML Basics 2
09 January 2014 09:51
HTML Blocks:
HTML <div> and <span>
HTML elements can be grouped together with <div> and <span>.
HTML Layouts
Web page layout is very important to make your website look good.
Design your webpage layout very carefully.
Website Layouts
Most websites have put their content in multiple columns (formatted like a magazine or newspaper).
Multiple columns are created by using <div> or <table> elements. CSS are used to position elements, or to create
backgrounds or colorful look for the pages.
Even though it is possible to create nice layouts with HTML tables, tables were designed for presenting tabular data -
NOT as a layout tool!
HTML Page 16
<body>
</div>
</body>
</html>
Try it yourself »
The HTML code above will produce the following result:
Main Title of Web Page
Menu
HTML
CSS
JavaScript
Content goes here
Copyright © W3Schools.com
<tr>
<td style="background-color:#FFD700;width:100px;">
<b>Menu</b><br>
HTML<br>
HTML Page 17
HTML<br>
CSS<br>
JavaScript
</td>
<td style="background-color:#EEEEEE;height:200px;width:400px;">
Content goes here</td>
</tr>
<tr>
<td colspan="2" style="background-color:#FFA500;text-align:center;">
Copyright © W3Schools.com</td>
</tr>
</table>
</body>
</html>
Try it yourself »
The HTML code above will produce the following result:
Main Title of Web Page
Menu Content goes here
HTML
CSS
JavaScript
Copyright © W3Schools.com
HTML Page 18
HTML Forms
25 December 2014 12:07
Text Fields
<input type="text"> defines a one-line input field that a user can enter text into:
<form>
First name: <input type="text" name="firstname"><br>
Last name: <input type="text" name="lastname">
</form>
Password Field
<input type="password"> defines a password field:
<form>
Password: <input type="password" name="pwd">
</form>
Radio Buttons
<input type="radio"> defines a radio button. Radio buttons let a user select ONLY ONE of a limited number of choices:
<form>
<input type="radio" name="sex" value="male">Male<br>
<input type="radio" name="sex" value="female">Female
</form>
Checkboxes
<input type="checkbox"> defines a checkbox. Checkboxes let a user select ZERO or MORE options of a limited number of
choices.
<form>
<input type="checkbox" name="vehicle" value="Bike">I have a bike<br>
<input type="checkbox" name="vehicle" value="Car">I have a car
</form>
Submit Button
<input type="submit"> defines a submit button.
A submit button is used to send form data to a server. The data is sent to the page specified in the form's action attribute.
The file defined in the action attribute usually does something with the received input:
<form name="input" action="html_form_action.asp" method="get">
Username: <input type="text" name="user">
<input type="submit" value="Submit">
</form>
HTML Page 19
</form>
If you type some characters in the text field above, and click the "Submit" button, the browser will send your input to a
page called "html_form_action.asp". The page will show you the received input.
HTML Page 20
HTML Tag Reference
09 January 2014 09:55
HTML Page 21
<br> Defines a single line break
<button> Defines a clickable button
<canvas> Used to draw graphics, on the fly, via scripting (usually
New JavaScript)
<caption> Defines a table caption
<center> Not supported in HTML5. Use CSS instead.
Defines centered text
<cite> Defines the title of a work
<code> Defines a piece of computer code
<col> Specifies column properties for each column within a
<colgroup> element
<colgroup> Specifies a group of one or more columns in a table for
formatting
<command> Defines a command button that a user can invoke
New
<datalist> Specifies a list of pre-defined options for input controls
New
<dd> Defines a description/value of a term in a description list
<del> Defines text that has been deleted from a document
<details> Defines additional details that the user can view or hide
New
<dfn> Defines a definition term
<dialog> Defines a dialog box or window
New
<dir> Not supported in HTML5. Use <ul> instead.
Defines a directory list
<div> Defines a section in a document
<dl> Defines a description list
<dt> Defines a term/name in a description list
<em> Defines emphasized text
<embed> Defines a container for an external (non-HTML) application
New
<fieldset> Groups related elements in a form
<figcaption> Defines a caption for a <figure> element
New
<figure> Specifies self-contained content
New
<font> Not supported in HTML5. Use CSS instead.
HTML Page 22
<font> Not supported in HTML5. Use CSS instead.
Defines font, color, and size for text
<footer> Defines a footer for a document or section
New
<form> Defines an HTML form for user input
<frame> Not supported in HTML5.
Defines a window (a frame) in a frameset
<frameset> Not supported in HTML5.
Defines a set of frames
<h1> to Defines HTML headings
<h6>
<head> Defines information about the document
<header> Defines a header for a document or section
New
<hr> Defines a thematic change in the content
<html> Defines the root of an HTML document
<i> Defines a part of text in an alternate voice or mood
<iframe> Defines an inline frame
<img> Defines an image
<input> Defines an input control
<ins> Defines a text that has been inserted into a document
<kbd> Defines keyboard input
<keygen> Defines a key-pair generator field (for forms)
New
<label> Defines a label for an <input> element
<legend> Defines a caption for a <fieldset> element
<li> Defines a list item
<link> Defines the relationship between a document and an external
resource (most used to link to style sheets)
<map> Defines a client-side image-map
<mark>New Defines marked/highlighted text
<menu> Defines a list/menu of commands
<meta> Defines metadata about an HTML document
<meter> Defines a scalar measurement within a known range (a gauge)
New
<nav>New Defines navigation links
<noframes> Not supported in HTML5.
HTML Page 23
<noframes> Not supported in HTML5.
Defines an alternate content for users that do not support
frames
<noscript> Defines an alternate content for users that do not support
client-side scripts
<object> Defines an embedded object
<ol> Defines an ordered list
<optgroup> Defines a group of related options in a drop-down list
<option> Defines an option in a drop-down list
<output> Defines the result of a calculation
New
<p> Defines a paragraph
<param> Defines a parameter for an object
<pre> Defines preformatted text
<progress> Represents the progress of a task
New
<q> Defines a short quotation
<rp>New Defines what to show in browsers that do not support ruby
annotations
<rt>New Defines an explanation/pronunciation of characters (for East
Asian typography)
<ruby>New Defines a ruby annotation (for East Asian typography)
<s> Defines text that is no longer correct
<samp> Defines sample output from a computer program
<script> Defines a client-side script
<section> Defines a section in a document
New
<select> Defines a drop-down list
<small> Defines smaller text
<source> Defines multiple media resources for media elements (<video>
New and <audio>)
<span> Defines a section in a document
<strike> Not supported in HTML5. Use <del> instead.
Defines strikethrough text
<strong> Defines important text
<style> Defines style information for a document
<sub> Defines subscripted text
HTML Page 24
<summary> Defines a visible heading for a <details> element
New
<sup> Defines superscripted text
<table> Defines a table
<tbody> Groups the body content in a table
<td> Defines a cell in a table
<textarea> Defines a multiline input control (text area)
<tfoot> Groups the footer content in a table
<th> Defines a header cell in a table
<thead> Groups the header content in a table
<time>New Defines a date/time
<title> Defines a title for the document
<tr> Defines a row in a table
<track>New Defines text tracks for media elements (<video> and <audio>)
<tt> Not supported in HTML5. Use CSS instead.
Defines teletype text
<u> Defines text that should be stylistically different from normal
text
<ul> Defines an unordered list
<var> Defines a variable
<video>New Defines a video or movie
<wbr>New Defines a possible line-break
HTML Page 25
HTML Global Attributes
09 January 2014 09:55
HTML Page 26
HTML Global Event Attributes
09 January 2014 09:54
Form Events
Events triggered by actions inside a HTML form (applies to almost all HTML elements, but is most used in form elements):
Attribute Value Description
onblur script Fires the moment that the element loses focus
onchange script Fires the moment when the value of the element is changed
oncontextmenuNew script Script to be run when a context menu is triggered
onfocus script Fires the moment when the element gets focus
onformchangeNew script Script to be run when a form changes
onforminputNew script Script to be run when a form gets user input
oninputNew script Script to be run when an element gets user input
oninvalidNew script Script to be run when an element is invalid
onreset script Fires when the Reset button in a form is clicked
Not supported in HTML5
onselect script Fires after some text has been selected in an element
HTML Page 27
onselect script Fires after some text has been selected in an element
onsubmit script Fires when a form is submitted
Keyboard Events
Attribute Value Description
onkeydown script Fires when a user is pressing a key
onkeypress script Fires when a user presses a key
onkeyup script Fires when a user releases a key
Mouse Events
Events triggered by a mouse, or similar user actions:
Attribute Value Description
onclick script Fires on a mouse click on the element
ondblclick script Fires on a mouse double-click on the element
ondragNew script Script to be run when an element is dragged
ondragendNew script Script to be run at the end of a drag operation
ondragenterNew script Script to be run when an element has been dragged to a valid drop target
ondragleaveNew script Script to be run when an element leaves a valid drop target
ondragoverNew script Script to be run when an element is being dragged over a valid drop target
ondragstartNew script Script to be run at the start of a drag operation
ondropNew script Script to be run when dragged element is being dropped
onmousedown script Fires when a mouse button is pressed down on an element
onmousemove script Fires when the mouse pointer moves over an element
onmouseout script Fires when the mouse pointer moves out of an element
onmouseover script Fires when the mouse pointer moves over an element
onmouseup script Fires when a mouse button is released over an element
onmousewheelNew script Script to be run when the mouse wheel is being rotated
onscrollNew script Script to be run when an element's scrollbar is being scrolled
Media Events
Events triggered by medias like videos, images and audio (applies to all HTML elements, but is most common in media
elements, like <audio>, <embed>, <img>, <object>, and <video>):
Attribute Value Description
onabort script Script to be run on abort
oncanplayNew script Script to be run when a file is ready to start playing (when it has buffered enough to begin)
oncanplaythroughN script Script to be run when a file can be played all the way to the end without pausing for
ew buffering
ondurationchangeN script Script to be run when the length of the media changes
ew
onemptiedNew script Script to be run when something bad happens and the file is suddenly unavailable (like
unexpectedly disconnects)
onendedNew script Script to be run when the media has reach the end (a useful event for messages like
"thanks for listening")
onerrorNew script Script to be run when an error occurs when the file is being loaded
onloadeddataNew script Script to be run when media data is loaded
onloadedmetadata script Script to be run when meta data (like dimensions and duration) are loaded
New
HTML Page 28
New
onloadstartNew script Script to be run just as the file begins to load before anything is actually loaded
onpauseNew script Script to be run when the media is paused either by the user or programmatically
onplayNew script Script to be run when the media is ready to start playing
onplayingNew script Script to be run when the media actually has started playing
onprogressNew script Script to be run when the browser is in the process of getting the media data
onratechangeNew script Script to be run each time the playback rate changes (like when a user switches to a slow
motion or fast forward mode)
onreadystatechange script Script to be run each time the ready state changes (the ready state tracks the state of the
New media data)
onseekedNew script Script to be run when the seeking attribute is set to false indicating that seeking has ended
onseekingNew script Script to be run when the seeking attribute is set to true indicating that seeking is active
onstalledNew script Script to be run when the browser is unable to fetch the media data for whatever reason
onsuspendNew script Script to be run when fetching the media data is stopped before it is completely loaded for
whatever reason
ontimeupdateNew script Script to be run when the playing position has changed (like when the user fast forwards to
a different point in the media)
onvolumechangeNe script Script to be run each time the volume is changed which (includes setting the volume to
w "mute")
onwaitingNew script Script to be run when the media has paused but is expected to resume (like when the
media pauses to buffer more data)
HTML Page 29
HTML Quick List
10 January 2014 21:32
HTML Quick List from W3Schools. Print it, fold it, and put it in your pocket.
<p>This is a paragraph.</p>
<br> (line break)
<hr> (horizontal rule)
<!-- This is a comment -->
Formatting
<b>Bold text</b>
<code>Computer code</code>
<em>Emphasized text</em>
<i>Italic text</i>
<kbd>Keyboard input</kbd>
<pre>Preformatted text</pre>
<small>Smaller text</small>
<strong>Important text</strong>
<abbr> (abbreviation)
<address> (contact information)
<bdo> (text direction)
<blockquote> (a section quoted from another source)
<cite> (title of a work)
<del> (deleted text)
<ins> (inserted text)
<sub> (subscripted text)
HTML Page 30
<sub> (subscripted text)
<sup> (superscripted text)
Links
Ordinary link: <a href="http://www.example.com/">Link-text goes here</a>
Image-link: <a href="http://www.example.com/"><img src="URL" alt="Alternate Text"></a>
Mailto link: <a href="mailto:webmaster@example.com">Send e-mail</a>
Bookmark:
<a id="tips">Tips Section</a>
<a href="#tips">Jump to the Tips Section</a>
Images
<img src="URL" alt="Alternate Text" height="42" width="42">
Styles/Sections
<style type="text/css">
h1 {color:red;}
p {color:blue;}
</style>
</form>
Entities
< is the same as <
> is the same as >
© is the same as ©
HTML Page 32
Website Hosting Tips
10 January 2014 21:44
HTML Page 33
HTML Vs XHTML
09 January 2014 06:39
What Is XHTML?
XHTML stands for EXtensible HyperText Markup Language
XHTML is almost identical to HTML 4.01
XHTML is a stricter and cleaner version of HTML
XHTML is HTML defined as an XML application
XHTML is supported by all major browsers.
Why XHTML?
Many pages on the internet contain "bad" HTML.
The following HTML code will work fine if you view it in a browser (even if it does NOT follow the HTML rules):
<html>
<head>
<title>This is bad HTML</title>
<body>
<h1>Bad HTML
<p>This is a paragraph
</body>
XML is a markup language where documents must be marked up correctly and "well-formed".
If you want to study XML, please read our XML tutorial.
Today's market consists of different browser technologies. Some browsers run on computers, and some browsers run on
mobile phones or other small devices. Smaller devices often lack the resources or power to interpret a "bad" markup
language.
Therefore - by combining the strengths of HTML and XML, XHTML was developed. XHTML is HTML redesigned as XML.
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Title of document</title>
HTML Page 34
<title>Title of document</title>
</head>
<body>
......
</body>
</html>
HTML Page 35
<input checked>
<input readonly>
<input disabled>
<option selected>
This is correct:
<input checked="checked">
<input readonly="readonly">
<input disabled="disabled">
<option selected="selected">
The XHTML 1.0 check list: Here’s the list of things you must do to convert from HTML to XHTML
❏ Change your DOCTYPE to Strict XHTML. Or, you can use Transitional XHTML if you’re still using Transitional HTML.
❏ Add the xmlns, lang, and xml:lang attributes to your <html> opening tag.
❏ The <html> tag must be the first tag after the DOCTYPE and the </html> closing tag must be the last tag in the document.
❏ All element names must be written with lowercase letters.
❏ All opening tags must have closing tags. Or, if an element is empty, the tag must end with a space and then />.
❏ All attributes must have values, and those values must be surrounded by double quotes.
❏ Don’t use & in the content of your HTML. & is for starting entities, so use & instead. Also convert any other special
characters to entities.
<body>
</body>
</html>
HTML Page 36
HTML 5 About
11 January 2014 07:07
HTML5 Multimedia
With HTML5, playing video and audio is easier than ever.
HTML5 <video>
HTML5 <audio>
HTML5 Graphics
With HTML5, drawing graphics is easier than ever:
Using the <canvas>element
Using inline SVG
Using CSS3 2D/3D
HTML5 Applications
With HTML5, web application development is easier than ever.
Local data storage
Local file access
Local SQL database
Application cache
Javascript workers
XHTMLHttpRequest 2
Semantic Elements
New elements for headers, footers, menus, sections and articles.
Sections can be used in place of <div> judicially.
HTML5 Forms
New form elements, new attributes, new input types, automatic validation.
Greatly helps in validating a form.
HTML Page 38
Intro
11 January 2014 07:18
What is HTML5?
HTML5 will be the new standard for HTML.
The previous version of HTML, HTML 4.01, came in 1999. The internet has changed significantly since then.
HTML5 is intended to subsume not only HTML 4, but also XHTML 1 and DOM Level 2 HTML.
HTML5 is designed to deliver almost everything you want to do online without requiring additional plugins. It does
everything from animation to apps, music to movies, and can also be used to build complicated applications that run in your
browser.
HTML5 is also cross-platform (it does not care whether you are using a tablet or a smartphone, a netbook, notebook or a
Smart TV).
HTML5 can also be used to write web applications that still work when you are not online.
The HTML 5 working group includes AOL, Apple, Google, IBM, Microsoft, Mozilla, Nokia, Opera, and hundreds of other
vendors.
HTML5 is still a work in progress. However, all major browsers support many of the new HTML5 elements and APIs.
<body>
Content of the document......
</body>
</html>
HTML Page 39
New form controls, like calendar, date, time, email, url, search
HTML Page 40
HTML5 New Elements
11 January 2014 07:35
HTML Page 41
<header> Defines a header for a document or section
<mark> Defines marked/highlighted text
<meter> Defines a scalar measurement within a known range (a gauge)
<nav> Defines navigation links
<progress> Represents the progress of a task
<ruby> Defines a ruby annotation (for East Asian typography)
<rt> Defines an explanation/pronunciation of characters (for East Asian typography)
<rp> Defines what to show in browsers that do not support ruby annotations
<section> Defines a section in a document
<time> Defines a date/time
<wbr> Defines a possible line-break. [it is different from <br>, which makes line-break compulsory]
Removed Elements
The following HTML 4.01 elements are removed from HTML5:
<acronym>
<applet>
<basefont>
<big>
<center>
<dir>
<font>
<frame>
<frameset>
<noframes>
<strike>
<tt>
HTML Page 42
HTML5 Canvas
11 January 2014 09:10
HTML Page 43
SVG
11 January 2014 09:10
What is SVG?
SVG stands for Scalable Vector Graphics
SVG is used to define vector-based graphics for the Web
SVG defines the graphics in XML format
SVG graphics do NOT lose any quality if they are zoomed or resized
Every element and every attribute in SVG files can be animated
SVG is a W3C recommendation
SVG Advantages
Advantages of using SVG over other image formats (like JPEG and GIF) are:
SVG images can be created and edited with any text editor
SVG images can be searched, indexed, scripted, and compressed
SVG images are scalable
SVG images can be printed with high quality at any resolution
SVG images are zoomable (and the image can be zoomed without degradation)
HTML Page 44
Sample
Monday, March 28, 2016 11:27 AM
<html lang="en">
<head>
Utf-8
</head>
</html>
HTML Page 45
HTML
24 February 2015 08:15
Basic HTML
Tag Description
<!DOCTYPE> Defines the document type
<html> Defines an HTML document
<title> Defines a title for the document
<body> Defines the document's body
<h1> to <h6> Defines HTML headings
<p> Defines a paragraph
<br> Inserts a single line break
<hr> Defines a thematic change in the content
<!--...--> Defines a comment
Formatting
Tag Description
<acronym> Not supported in HTML5. Use <abbr> instead.
Defines an acronym
<abbr> Defines an abbreviation or an acronym
<address> Defines contact information for the author/owner of a document/article
<b> Defines bold text
<bdi> Isolates a part of text that might be formatted in a different direction from other text outside it
<bdo> Overrides the current text direction
<big> Not supported in HTML5. Use CSS instead.
Defines big text
<blockquote> Defines a section that is quoted from another source
<center> Not supported in HTML5. Use CSS instead.
Defines centered text
<cite> Defines the title of a work
<code> Defines a piece of computer code
<del> Defines text that has been deleted from a document
<dfn> Represents the defining instance of a term
<em> Defines emphasized text
<font> Not supported in HTML5. Use CSS instead.
Defines font, color, and size for text
<i> Defines a part of text in an alternate voice or mood
HTML Page 46
<i> Defines a part of text in an alternate voice or mood
<ins> Defines a text that has been inserted into a document
<kbd> Defines keyboard input
<mark> Defines marked/highlighted text
<meter> Defines a scalar measurement within a known range (a gauge)
<pre> Defines preformatted text
<progress> Represents the progress of a task
<q> Defines a short quotation
<rp> Defines what to show in browsers that do not support ruby annotations
<rt> Defines an explanation/pronunciation of characters (for East Asian typography)
<ruby> Defines a ruby annotation (for East Asian typography)
<s> Defines text that is no longer correct
<samp> Defines sample output from a computer program
<small> Defines smaller text
<strike> Not supported in HTML5. Use <del> or <s> instead.
Defines strikethrough text
<strong> Defines important text
<sub> Defines subscripted text
<sup> Defines superscripted text
<time> Defines a date/time
<tt> Not supported in HTML5. Use CSS instead.
Defines teletype text
<u> Defines text that should be stylistically different from normal text
<var> Defines a variable
<wbr> Defines a possible line-break
HTML Page 47
<output> Defines the result of a calculation
Frames
Tag Description
<frame> Not supported in HTML5.
Defines a window (a frame) in a frameset
<frameset> Not supported in HTML5.
Defines a set of frames
<noframes> Not supported in HTML5.
Defines an alternate content for users that do not support frames
<iframe> Defines an inline frame
Images
Tag Description
<img> Defines an image
<map> Defines a client-side image-map
<area> Defines an area inside an image-map
<canvas> Used to draw graphics, on the fly, via scripting (usually JavaScript)
<figcaption> Defines a caption for a <figure> element
<figure> Specifies self-contained content
Audio / Video
Tag Description
<audio> Defines sound content
<source> Defines multiple media resources for media elements (<video> and <audio>)
<track> Defines text tracks for media elements (<video> and <audio>)
<video> Defines a video or movie
Links
Tag Description
<a> Defines a hyperlink
<link> Defines the relationship between a document and an external resource (most used to link to style sheets)
<nav> Defines navigation links
Lists
Tag Description
<ul> Defines an unordered list
<ol> Defines an ordered list
<li> Defines a list item
<dir> Not supported in HTML5. Use <ul> instead.
Defines a directory list
<dl> Defines a description list
<dt> Defines a term/name in a description list
HTML Page 48
<dt> Defines a term/name in a description list
<dd> Defines a description of a term/name in a description list
<menu> Defines a list/menu of commands
<menuitem> Defines a command/menu item that the user can invoke from a popup menu
Tables
Tag Description
<table> Defines a table
<caption> Defines a table caption
<th> Defines a header cell in a table
<tr> Defines a row in a table
<td> Defines a cell in a table
<thead> Groups the header content in a table
<tbody> Groups the body content in a table
<tfoot> Groups the footer content in a table
<col> Specifies column properties for each column within a <colgroup> element
<colgroup> Specifies a group of one or more columns in a table for formatting
Meta Info
Tag Description
<head> Defines information about the document
<meta> Defines metadata about an HTML document
<base> Specifies the base URL/target for all relative URLs in a document
<basefont> Not supported in HTML5. Use CSS instead.
Specifies a default color, size, and font for all text in a document
Programming
HTML Page 49
Programming
Tag Description
<script> Defines a client-side script
<noscript> Defines an alternate content for users that do not support client-side scripts
<applet> Not supported in HTML5. Use <embed> or <object> instead.
Defines an embedded applet
<embed> Defines a container for an external (non-HTML) application
<object> Defines an embedded object
<param> Defines a parameter for an object
HTML Page 50