Module 2 - HTML 5
Module 2 - HTML 5
Mrs.V.Mareeswari
Assistant Professsor(Sr)
School of Information Technology and Engineering
VIT,Vellore
Cabin No:SJT 210-A30
What is HTML5?
HTML5 is a standard for structuring and presenting content on
the World Wide Web.
Superseding of HTML 4.01 and XHTML 1.1. Top 10 design trends in 2020
The historic logo made by the W3C https://youtu.be/T6Jcl-GqeBA
Tim Berners-Lee
HTML5 is a cooperation between the World
Wide Web Consortium (W3C) and the Web
Hypertext Application Technology Working
Group (WHATWG
1
2/15/2021
Tags or Elements
Basically, a computer sees an "A" as simply an "A" - whether it is bold,
italic, big or small. To tell the browser that an "A" should be bold we
need to put a markup in front of the A. Such a markup is called a Tag.
All HTML tags are enclosed in < and >.
Example text in web page: a piece of text as it appears on the screen.
This is an example of bold text.
HTML code: This is an example of <b>bold</b> text.
As you can see, the start tag <b> indicates that whatever follows
should be written in bold. The corresponding end tag </b> indicates
that the browser should stop writing text in bold.
Although some tags, known as empty elements, are unpaired, e.g <img>. Support all existing web pages. With HTML5, there is no requirement to
go back and revise older websites.
Attributes : Elements may contain attributes that are used to set
various properties of an element. <div class = "example">...</div> Handle web documents errors in a better and more consistent fashion.
7 V.Mareeswari / AP(Sr) / SITE / VIT 8 Dr.Mareeswari V/ AP(Sr) / SITE / VIT
2
2/15/2021
Two parts
<HEAD>
<!--This section is for the title and technical info of the page.
The head is used for text and tags that do not show directly on the page. -->
<!DOCTYPE html> <TITLE> Welcome </TITLE>
The DOCTYPE tells the browser which type and version of document to </HEAD>
expect. This should be the last time the DOCTYPE is ever changed. From <BODY> <!-- This section is for all that you want to show on the page. -->
now on, all future versions of HTML will use this same simplified declaration.
<! Insert only BODY tags. >
<html lang="en"> <H1> Hello World </H1>
<!-- Rest of page goes here.
The lang attribute in the <html> element declares which language the page
content is in. Though not strictly required, it should always be specified, as it This is the multiple line comment. -->
can assist search engines and screen readers. e.g. Spanish = "es", French = </BODY>
"fr", German = "de", Chinese = "zh", Arabic = "ar".
3
2/15/2021
In the head section, always write a title: <title>The title of your Meta Tag
page</title>. Notice how the title will be shown in the upper left corner Metadata is data (information) about data.
of your browser: Metadata will not be displayed on the page, but will be machine
parsable.
Meta elements are typically used to specify page description,
keywords, author of the document, last modified, and other metadata.
The title is especially important because it is used by search engines (such
as Google) to index your website and is shown in the search results. Note: <meta> tags always goes inside the <head> element.
Note: Metadata is always passed as name/value pairs.
4
2/15/2021
Body Section
The body of the document contains all that can be seen when the user
HTML5 comes with a lot of flexibility and it supports the loads the page.
following features −
you can learn in detail about all the different aspects of HTML,
Uppercase tag names. including:
Quotes are optional for attributes. Text :Formatting, Resizing, Layout & Listing
Attribute values are optional. Links : To local pages, To pages at other sites & To bookmarks
Closing empty elements are optional. Images : Inserting images (GIF and jpg) & Adding a link to an image
Backgrounds : Colors & Images
Tables
Forms
5
2/15/2021
Headings
Headings
<HTML>
<HEAD>
<TITLE>Document Headings</TITLE>
<H1 ...> text </H1> -- largest of the six </HEAD>
<H2 ...> text </H2> <BODY>
Samples of the six heading types:
<H3 ...> text </H3> <H1>Level-1 (H1)</H1>
<H4 ...> text </H4> <H2 ALIGN="center">Level-2 (H2)</H2>
<H3><U>Level-3 (H3)</U></H3>
<H5 ...> text </H5> <H4 ALIGN="right">Level-4 (H4)</H4>
<H5>Level-5 (H5)</H5>
<H6 ...> text </H6> -- smallest of the six <H6>Level-6 (H6)</H6>
</BODY>
</HTML>
ALIGN="position" --left (default), center or right
6
2/15/2021
Paragraph
The <p> tag defines a paragraph. Using this tag places a blank
line above and below the text of the paragraph.
Attributes:
ID=p1
NAME=“Introduction”
ALIGN="position" (left, center, right)
Fully-specified text uses <P> and </P>
But </P> is optional.
Multiple <P>'s do not create blank lines.
Use <BR> for blank line.
Paragraph - Example
<HTML><BODY>
<P>Here is some text Here is some text Here is some text Here is some text Here is some
text Here is some text Here is some text Here is some text Here is some text Here is
some text Here is some text Here is some text Here is some text Here is some text Here
is some text Here is some textHere is some text Here is some text Here is some text
Here is some text</P>
<P ALIGN="center"> Centered text Centered text Centered text Centered textCentered
text Centered textCentered textCentered textCentered textCentered textCentered
textCentered textCentered textCentered textCentered textCentered textCentered
textCentered textCentered textCentered textCentered textCentered text</P>
<p><p><p><p>
<P ALIGN="right"> Right-justified text Right-justified text Right-justified text Right-
justified text Right-justified text Right-justified text Right-justified text Right-justified
text Right-justified text Right-justified text Right-justified text Right-justified text Right-
justified text Right-justified text Right-justified text
<! Note: no closing /P tag is not a problem>
</BODY></HTML>
7
2/15/2021
8
2/15/2021
<address>
<address>
<PRE> Preformatted Text
<a
href="mailto:[email protected]">[email protected]</a> <PRE>
<br> if (a < b) {
<a href="tel:+13115552368">(311) 555-2368</a><br> a++;
b = c * d;
<a href="tel:04162202740">0416 220 2740</a> }
</address> else {
a--;
b = (b-1)/2;
}
</PRE>
9
2/15/2021
Image
Colors In HTML, images are defined with the <img> tag. It is empty, which means
that it contains attributes only, and has no closing tag.
Values for BGCOLOR and COLOR The value of the src (source) attribute is the URL of the image you want to
Example: 3 ways display.
<body bgcolor=“AA22FF” > The alt attribute specifies alternate text to be displayed if for some reason the
<p color =“black”> browser cannot find the image, or if a user has image files disabled.
<body bgcolor =“rgb(200,200,200)”> To define the height and width of the image, use the height and width attributes.
rgb(0,0,0)black, rgb(255,255,255)white Use the align attributes to place images within your body, tables, or sections.
Tips: Hexa Decimal representation is best. All colors can be specified <img src=“sunset.jpg" alt=“ Sunset Image" align=“left/right/center”
as a six character hexadecimal value: RRGGBB width="304" height="228" >
Tips
Tips:: Jpeg images have an unlimited color wheel, and have a high compression
rate downsizing your load times and saving hard drive space. Its best to use
Jpegs for photo galleries, or artwork. Gif images are best used for banners, clip
art, and buttons.
39 V.Mareeswari / AP(Sr) / SITE / VIT 40 V.Mareeswari / AP(Sr) / SITE / VIT
10
2/15/2021
Anchor Attribute
The href attribute defines reference that the link refers to. Basically this is
where the user will be taken if they wish to click this link.
The target attribute defines whether to open the page in a separate
window, or to open the link in the current browser window.
< a href=“htttp://www.mail.vit.ac.in” target=“_blank”> VIT Email
</a>
11
2/15/2021
Email Link
Creating an email link is
simple. If you want
Folder Link / download links
somebody to mail you With HTML, absolute pathnames begin with a slash (/) and are
about your site a good way followed by a sequence of folders beginning with the highest
to do it is place an email level folder and proceeding to the folder that contains the file.
link with a subject already <a href="d:/IWP/Material/Unit I.pptx">Unit I
in place for them. Material</a>
<a <a href =“http://www.mwu.edu/course/info.html”>Course
href="mailto:vmareeswari Information</a>
@vit.ac.in?subject=Feedba <a href= “ftp://192.168.4.76/lab/SWE312 IWP Lab/Basics
ck&body= Sweet site"> of HTML.pdf ”> Lab Material</a>
Send Mail</a> <a href=“/downloads/test.zip">Download Zip file</a>
12
2/15/2021
Default Link
Use the <base> tag in the head element to set a default URL for all
links on a page to go to.
It's always a good idea to set a base tag just incase your links become
bugged somewhere down the line. Usually set your base to your
home page.
<head>
<base href="http://www.vit.ac.in">
</head>
<a href="home.asp">LINK</a>
List
There are 3 different types of lists.
A <ol> tag starts an ordered list, <ul> for unordered lists, and
<dl> for definition lists.
Use the type and start attributes to fine tune your lists
accordingly.
1. <ul> - unordered list; bullets
2. <ol> - ordered list; numbers
3. <dl> - definition list; dictionary
Demo
13
2/15/2021
Table
The <table> tag is used to begin a table.
Definition List Within a table element are the <tr> (table rows) and <td> (table
A definition list is a list of items, with a description of each columns) tags.
item. A table cell is defined by <td> and </td>.
The <dl> tag defines a definition list. The border attribute defines how wide the table's border will be.
The <dl> tag is used in conjunction with <dt> (defines the
If you would like to place headers at the top of your columns, use the
item in the list) and <dd> (describes the item in the list)
<th> tag.
<dl>
<dt>Coffee</dt> Use rowspan to span multiple rows and colspan to span multiple
Coffee
<dd>black hot drink</dd> columns.
black hot drink
<dt>Milk</dt> With the cellpadding and cellspacing attributes you will be able to adjust
Milk
<dd>white cold drink</dd> the white space on your tables.
white cold drink
</dl> Spacing defines the width of the border, while padding represents the
distance between cell borders and the content within.
55 V.Mareeswari / AP(Sr) / SITE / VIT 56 V.Mareeswari / AP(Sr) / SITE / VIT
14
2/15/2021
Simple Table
<html> <head> <title>HTML Tables</title> </head> <body>
<table border = "1">
<tr>
<th>Name</th>
<th>Salary</th> </tr>
<tr>
<td>Ramesh Raman</td>
<td>5000</td> </tr>
<tr>
<td>Shabbir Hussein</td>
<td>7000</td> </tr>
</table> </body> </html>
V.Mareeswari / AP(Sr) / SITE / VIT V.Mareeswari / AP(Sr) / SITE / VIT
57 58
15
2/15/2021
The <col> element defines a column within a table and defining common
semantics on all common cells. It is found within a <colgroup> element.
rowsgroup establishes a relationship <colgroup> defines a group of columns within a table.
between owned row elements and is a
structural equivalent to
the thead, tfoot and tbody elements in
HTML.
16
2/15/2021
sandbox in <iframe>
sandbox Enables an extra set of restrictions for the content in an <iframe>
JavaScript will not execute in the framed document.
Over time, we have gotten used to integrate more and more content Forms cannot be submitted.
on our web pages. Sometimes these content come from third parties Plugins will not load. (Flash, Silverlight plugins, or Java applets )
(social networks widgets, advertising, etc). It implies two The framed document cannot create new windows or dialogs
consequences: the webpages size continues to rise, and we display to (via window.open or target="_blank", for instance).
the users some content that we can’t fully control. Features that trigger automatically (autofocused form elements,
Some of these external content are integrated via the <iframe> tag, autoplaying videos, etc.) are blocked.
and you should pay special attention to these elements for your AJAX requests can’t be initiated
website’s security. To limit the risks, the W3C added the sandbox
You limit the storage capabilities on the browser (eg: using cookies
attribute in the HTML5 specifications, allowing to restrict the
or localStorage is impossible)
actions available from an iframe
<iframe sandbox src=”...”></iframe>
67 Dr.Mareeswari V/ AP(Sr) / SITE / VIT 68 Dr.Mareeswari V/ AP(Sr) / SITE / VIT
17
2/15/2021
Div Tag
The <div> tag defines a division or a section in an HTML document.
The <div> tag is used to group block-elements to format them with
styles.
The <div> element is very often used together with CSS, to layout a
web page.
Attributes: id, width, height, title, style
For the purpose of this example, we have included the style attribute in
order to color our div tag in order to bring a stronger visualization for
our viewers.
When HTML first began, web creators only had two choices. A, table
layout or frame. The div element provides a 3rd alternative, since a div
can contain any/every other type of html element within its beginning
and ending tag.
71 Dr.Mareeswari V/ AP(Sr) / SITE / VIT
72 V.Mareeswari / AP(Sr) / SITE / VIT
18
2/15/2021
<body> Demo
<div style="color:#00FF00">
<h3>This is a header</h3>
<p>This is a paragraph.</p>
<h5>Content Articles</h5>
<p>This paragraph would be your content
paragraph with all of your readable material.</p>
</div>
<div id="menu" align="right" style="color:#FF0000“>Links:<a
href="">HOME</a> | <a href="">CONTACT</a> | <a
href="">ABOUT</a> |</div><br>
<div style="background: green">
<h5 >SEARCH LINKS</h5>
<a target="_blank" href="http://www.google.com">Google</a>
</div> </body>
74 Dr.Mareeswari V/ AP(Sr) / SITE / VIT
73 V.Mareeswari / AP(Sr) / SITE / VIT
Address #1
radio Windows
<span style="color:blue;font-weight:bold"> buttons
Religious or Charitable Institution
Government IBM Lan Server check
Educational Institution PC/NFS boxes
blue</span> eyes and my father has
text
<span style="color:darkolivegreen;font-weight: Comments?: area
19
2/15/2021
20
2/15/2021
Demo
21
2/15/2021
22
2/15/2021
The wrap attribute refers to how the text reacts when it reaches the end <textarea cols="20" rows="5" readonly="yes">As you can
of each row in the text field. see many times word wrapping is often the desired look for
Wrapping can be one of three settings: soft, hard, off your textareas. Since it makes everything nice and easy to
Soft forces the words to wrap once inside the text area but when the
read.</textarea>
form is submitted, the words will no longer appear as such (Line breaks <textarea cols="20" rows="5" disabled="yes">
will not be added). As you can see many times word wrapping is often the desired
Hard wraps the words inside the text box and places line breaks at the look for your text areas. Since it makes everything nice and
end of each line so that when the form is submitted it appears exactly as easy to read.
it does in the text box.
Off sets a textarea to ignore all wrapping and places the text into one
ongoing line.
<textarea cols="20" rows="5" wrap="hard"
readonly="yes">As you can see many times word wrapping
is often the desired look for your textareas. Since it makes
89 everything nice
V.Mareeswari / AP(Sr) and
/ SITE / VIT easy to read.</textarea> 90 V.Mareeswari / AP(Sr) / SITE / VIT
23
2/15/2021
<form>
<input type="number"><br>
type=search
<input type="range"><br> <form action="http://www.google.com/search" method="get">
<input type="date"><br> <label>Google:
<input type=" time"><br> <input type="search" name="q"></label>
<input type="datetime-local"> <input type="submit" value="Search...">
<input type="color"><br> </form>
Telephone<input type="tel"><br> <form action="http://www.bing.com/search" method="get">
Email<input type="email"> <br> <label>Bing: <input type="search" name="q"></label>
URL<input type="url"><br> <input type="submit" value="Search...">
<input type="hidden" name="MAX_FILE_SIZE" value="500" /> </form>
</form>
Added Attribute
placeholder
type =image It should only be used for short descriptions and set in form field.
Always specify both the height and width attributes for images. If For anything longer, use the title attribute.
height and width are set, the space required for the image is reserved <input type="text“ id="user-name" placeholder="at least 3
when the page is loaded. Without these attributes, the browser does characters">
not know the size of the image, and cannot reserve the appropriate autofocus
space to it. The effect will be that the page layout will change during Adding it to an input automatically focuses that field when the page
loading (while the images load). is rendered.
<input type="image" src="img_submit.gif" alt="Submit" <input type="text" name="first-name“ autofocus>
width="48" height="48"> autocomplete
The autocomplete attribute helps users complete forms based on
earlier input. The default state is set to on.
<input type="text id="tracking-code" autocomplete="off">
95 Dr.Mareeswari V/ AP(Sr) / SITE / VIT 96 Dr.Mareeswari V/ AP(Sr) / SITE / VIT
24
2/15/2021
required
list and datalist
By adding it to a form field, the browser requires the user to enter data
into that field before submitting the form. The input list attribute refers to a <datalist> element that
<input type="text" id="given-name“ required>
contains pre-defined options for an <input> element.
pattern <input list="browsers">
pattern makes it easy for us to implement specific validation for
<datalist id="browsers">
product codes, invoice numbers, and so on. <option value="Internet Explorer">
<option value="Firefox">
<input type="tel" id="phone“ placeholder="123-45-678"
pattern="[0-9]{3}-[0-9]{2}-[0-9]{3}"> <option value="Chrome">
<option value="Opera">
<option value="Safari">
</datalist>
multiple step
The input multiple attribute specifies that the user is allowed to enter The input step attribute specifies the legal number intervals for an
more than one value in an input field. It works with the following input field.
input types: email, and file. Example: if step="3", legal numbers could be -3, 0, 3, 6, etc.
<form action="/action_page.php"> Tip: This attribute can be used together with the max and min
attributes to create a range of legal values.
<label for="files">Select files:</label>
The step attribute works with the following input types: number,
<input type="file" id="files“ multiple><br><br> range, date, datetime-local, month, time and week.
<input type="submit" value="Submit"> </form> <input type="number" id="points“ step="3">
<p>To select multiple files, hold down the CTRL or SHIFT key while min and max
selecting.</p> The min and max attributes work with the following input types:
number, range, date, datetime-local, month, time and week.
<input type="date" id="datemax“ max="1979-12-31"><br><br>
<input type="number" id="quantity“ min="1" max="5"><br>
25
2/15/2021
Semantic Description
Elements
<output> element <header> Defines a header for a document
<footer> Defines a footer for a document.(author, copyright information, etc)
The <output> element represents the result of a calculation (like one <article> This tag represents an independent piece of content of a document, such as a blog entry or newspaper
article.
performed by a script). <aside> This tag represents a piece of content that is only slightly related to the rest of the page.
<audio> Allow to play audio on browser.
<form oninput="x.value=parseInt(a.value)+parseInt(b.value)"> <canvas> Used to draw Graphics on web.
<figure> Specifies self-contained content associated a caption together with some embedded content, such as a
0 <input type="range" id="a“ value="50"> 100 <br><br> graphic or video
<meter> Defines a scalar measurement within a known range
<input type="number" id="b“ value="50"> <br><br> <nav> Defines navigation links
<section> Defines a section in a document. It can be used together with h1-h6 to indicate the document structure.
Added value = <output name="x" for="a b"></output>
<source> Defines multiple media resources for media elements (audio and video)
<br><br> <video> Defines a video or movie
<progress> Represents the progress of a task
</form> <mark> Defines marked/highlighted text
<details> Used to create an interactive widget that the user can open and close
<bdi> Full form of BDI is Bi-Directional Isolation. This element is useful when embedding user-generated
content with an unknown directionality.
<summary> It specifies a visible heading for <detailed> element.
<wbr> Used for possible line bread
<time> Used for define date and time
<track> Used for defines text tracks for media elements (<video> and <audio>)
101 Dr.Mareeswari V/ AP(Sr) / SITE / VIT 102 <ruby>Dr.MareeswariUsed
V/ AP(Sr) / SITEa/ruby
for defines VIT annotation
<output> Used for represents the result of a calculation
<nav>
<a href="/css/" target="_blank">CSS</a> |
<a href="/html/" target="_blank">HTML</a> |
<a href="/javascript/" target="_blank">JavaScript</a>|
<a href="/sql/tutorial/" target="_blank">SQL</a>
file:///E:/Mareeswari/CSE2015/Program/HTML/semantic.html </nav>
file:///E:/Mareeswari/CSE2015/Program/HTML/semantic%20without.html
103 Dr.Mareeswari V/ AP(Sr) / SITE / VIT 104 Dr.Mareeswari V/ AP(Sr) / SITE / VIT
26
2/15/2021
<main> <main>
<h1>Web Browsers</h1>
• <main> tag is used to represent the main content area within an
<p>Google Chrome, Firefox, and Internet Explorer are the most used
HTML document. browsers today.</p>
• <main> tag surrounds the main content of the page - content <article>
<h1>Google Chrome</h1>
that is unique to that document and is obviously the "main" <p>Google Chrome is a free, open-source web browser developed by
Google, released in 2008.</p> </article>
content for that page. This excludes any content that is repeated <article>
<h1>Internet Explorer</h1>
across multiple pages (such as navigation bars, headers, footers, <p>Internet Explorer is a free web browser from Microsoft, released in
etc). 1995.</p> </article>
<article>
• An HTML document can have a maximum of <h1>Mozilla Firefox</h1>
one <main> element. It must not appear within <p>Firefox is a free, open-source web browser from Mozilla, released in
the <article>, <aside>, <footer>, <header> or <nav> tags. 2004.</p> </article></main>
105 Dr.Mareeswari V/ AP(Sr) / SITE / VIT 106 Dr.Mareeswari V/ AP(Sr) / SITE / VIT
<article> <section>
• Any given web page or article could have many sections.
• <article> tag is used to represent an article.
• For example, a homepage could have a section for introducing the
• The content within the <article> tag is independent from the other
content on the site (even though it could be related). company, another section for news items, and another section for
• By "independent" means that its contents could stand alone, for example in contact information.
syndication. <article>
<header><h1>Welcome</h1></header>
<article><h4>Environmentally Friendly City</h4> <section><h4>What We Do</h4><p>We protect
<p>A brand new city is being built in Abu Dhabi in the United sharks...</p></section>
Arab Emirates which, when finished, will be the world's first zero
<section> <h4>News Items</h4><p>Man eats
carbon, zero waste city.</p><p>Masdar City, a completely self
sustaining city, will be powered by renewable energy and all waste shark...</p></section>
will be recycled or reused.</p></article> <section> <h4>Contact Us</h4><p>At the
beach...</p></section></article>
107 Dr.Mareeswari V/ AP(Sr) / SITE / VIT 108 Dr.Mareeswari V/ AP(Sr) / SITE / VIT
27
2/15/2021
109 Dr.Mareeswari V/ AP(Sr) / SITE / VIT 110 Dr.Mareeswari V/ AP(Sr) / SITE / VIT
111 Dr.Mareeswari V/ AP(Sr) / SITE / VIT 112 Dr.Mareeswari V/ AP(Sr) / SITE / VIT
28
2/15/2021
<marquee> in html4
An HTML marquee is a scrolling piece of text displayed either
HTML5: Video
Until now, there hasn't been a standard for showing video on a web
horizontally across or vertically down your webpage depending on the
page.
settings.
Today, most videos are shown through a plugin (like Flash). However,
Attributes:
not all browsers have the same plugins.
width, height
HTML5 specifies a standard way to include video with the video
direction= up ,down ,left or right
element.
behavior – type of scrolling -> scroll, slide and alternate
Currently, there are 3 supported video formats for the video element:
loop – how many time to scroll
hspace = %
vspace = %
scrolldelay- This specifies how long to delay between each jump
113 V.Mareeswari / AP(Sr) / SITE / VIT 114 Dr.Mareeswari V/ AP(Sr) / SITE / VIT
<!DOCTYPE HTML>
<html><body>
<video src="movie.ogg" width="320" height="240"
controls="controls">
Your browser does not support the video tag.
</video>
</body> </html>
115 Dr.Mareeswari V/ AP(Sr) / SITE / VIT 116 Dr.Mareeswari V/ AP(Sr) / SITE / VIT
29
2/15/2021
HTML5: Video
HTML5: Video
<video width="320" height="240" controls="controls">
The last example uses an Ogg file, and will work in Firefox,
Opera and Chrome. <source src="movie.ogg" type="video/ogg" />
To make the video work in Safari and future versions of Chrome, <source src="movie.mp4" type="video/mp4" />
we must add an MPEG4 andWebM file. <source src="movie.webm" type="video/webm" />
The video element allows multiple source elements. Source Your browser does not support the video tag.
elements can link to different video files. The browser will use the </video>
first recognized format.
Internet Explorer 8 does not support the video element. In IE 9,
there will be support for video element using MPEG4. <source> tag is used to specify multiple media resources for
media elements, such as <video> and <audio>.
117 Dr.Mareeswari V/ AP(Sr) / SITE / VIT 118 Dr.Mareeswari V/ AP(Sr) / SITE / VIT
119 Dr.Mareeswari V/ AP(Sr) / SITE / VIT 120 Dr.Mareeswari V/ AP(Sr) / SITE / VIT
30
2/15/2021
The last example uses an Ogg file, and will work in Firefox, Opera
and Chrome.
To make the audio work in Safari, the audio file must be of type MP3
orWav.
The audio element allows multiple source elements. Source elements
can link to different audio files. The browser will use the first
recognized format.
Internet Explorer 8 does not support the audio element. In IE 9, there
will be support for audio element.
121 Dr.Mareeswari V/ AP(Sr) / SITE / VIT 122 Dr.Mareeswari V/ AP(Sr) / SITE / VIT
<img src="/lorikeet.jpg" alt="Cheeky looking Rainbow low number Specifies the range that is considered to be a low value
Lorikeet"> high number Specifies the range that is considered to be a high value
<figcaption>Australian Birds. From left to right, Kookburra, max number Specifies the maximum value of the range
Pelican and Rainbow Lorikeet. Originals by <a min number Specifies the minimum value of the range
href="http://www.flickr.com/photos/rclark/">Richard optimum number Specifies what value is the optimal value for the gauge
Clark</a></figcaption></figure> value number Required. Specifies the current value of the gauge
123 Dr.Mareeswari V/ AP(Sr) / SITE / VIT 124 Dr.Mareeswari V/ AP(Sr) / SITE / VIT
31
2/15/2021
125 Dr.Mareeswari V/ AP(Sr) / SITE / VIT 126 Dr.Mareeswari V/ AP(Sr) / SITE / VIT
<progress>
• Use the <progress> tag in conjunction with JavaScript to display the <dialog>
progress of a task.
• Indeterminate State: If the progress bar does not have a value The <dialog> tag defines a dialog box or window.
attribute then it will be in the indeterminate state.
The <dialog> element makes it easy to create popup
dialogs and modals on a web page.
Attribute Value Description
Attribute Value Description
max number Specifies how much work the task requires in total
value number Specifies how much of the task has been completed open open Specifies that the dialog element is active and
that the user can interact with it
<progress></progress>
Downloading progress:
<progress value="22" max="100"></progress>
127 Dr.Mareeswari V/ AP(Sr) / SITE / VIT 128 Dr.Mareeswari V/ AP(Sr) / SITE / VIT
32
2/15/2021
<div> <mark>
<dialog id="myFirstDialog" style="width:50%;background-
color:#F4FFEF;border:1px dotted black;"> <mark> tag is used for indicating text as marked or highlighted
<p><q>The world is full of magical things patiently waiting for our wits to for reference purposes, due to its relevance in another context.
grow sharper.</q> - <cite>Bertrand Russell</cite></p>
<button id="hide">Close</button></dialog> <p>Despite the stockmarket crash in 2008, the value of my share
<!-- "Show" button --><button id="show">Show
Dialog</button></div>
portfolio <mark>increased by 100 percent</mark>. I must be
<!-- JavaScript to provide the "Show/Close" functionality --> doing something right.</p> <p>I should point out that the value
<script type="text/JavaScript"> only increased because I kept pumping more money in!</p>
(function() {
var dialog = document.getElementById('myFirstDialog');
document.getElementById('show').onclick = function() {
dialog.show(); };
document.getElementById('hide').onclick = function() {
dialog.close(); }; })(); </script>
129 Dr.Mareeswari V/ AP(Sr) / SITE / VIT 130 Dr.Mareeswari V/ AP(Sr) / SITE / VIT
131 Dr.Mareeswari V/ AP(Sr) / SITE / VIT 132 Dr.Mareeswari V/ AP(Sr) / SITE / VIT
33
2/15/2021
<wbr>
The <wbr> (Word Break Opportunity) tag specifies where in a text it would be
ok to add a line-break.Tip: When a word is too long, or you are afraid that
the browser will break your lines at the wrong place, you can use the <wbr>
HTML5: Canvas
element to add word break opportunities.
<h2>Wikitechy wbr tag</h2> <p>
ThewbrIsAwordBreakOpportunity.<wbr>ThatIsUsedToProvideAOpportuni
tyToTheBrowserToCreateNewLine- The HTML5 canvas element uses JavaScript to draw graphics on a
Break.<wbr>WhenTheContentDidNotFitTo web page.
TheBrowserWindowThatWillBe<wbr>AutomaticallyTogglesLine-
A canvas is a rectangular area, and you control every pixel of it.
BreakOnIt. </p>
The canvas element has several methods for drawing paths, boxes,
circles, characters, and adding images.
Adding a canvas element to the HTML5 page.
<canvas id="myCanvas" width="200" height="100"></canvas>
133 Dr.Mareeswari V/ AP(Sr) / SITE / VIT 134 Dr.Mareeswari V/ AP(Sr) / SITE / VIT
HTML5: Canvas
The canvas element has no drawing abilities of its own. All drawing must
be done inside a JavaScript: HTML 5 differences from HTML 4
135 Dr.Mareeswari V/ AP(Sr) / SITE / VIT 136 Dr.Mareeswari V/ AP(Sr) / SITE / VIT
34