Html5: Test
Html5: Test
Tag
Word enclosed in < and >
Also known as element
Pre-defined by W3C
E.g.
<h1>, <p>, <table>
Types
o Opening tag
Used to open the information
E.g.
<title>, <html>
o Closing tag
Used to close the information
E.g.
</title>, </html>
o Empty tag
Tag with no data/content
Can be written
<br></br>
<br />
E.g.
<br/>, <hr/>
o Root tag
Tag which starts and ends the document
Every html file must have <html> as its root tag
Root tag is also called as
Root element
Document element
Document Type
Attribute
o Used to add extra information about the tag
o It is always present in name = value format
o An element may contain zero or more attributes
o E.g.
<meta charset=”utf-8”>
Where
Meta: element / tag
Charset: attribute name
Utf-8: attribute value
o Every html element contains
name:
class:
id:
style:
Body
Textual
o Heading
Used to create heading
<h1>-<h6>
o Paragraph: <p>
o Span:
o Div:
Resources
o Image:
Use tag: <img>
E.g.
<audio>
<source src=”path”>
</audio>
attributes
controls: display the controls (to play/scrub/mute)
autoplay: to play the audio/video automatically when page
loading completed
List
o Ordered List
Maintains the order
E.g.
<ol>
<li>item 1</li>
<li>item 2</li>
</ol>
o Unordered List
Does not maintain the order
E.g.
<ul>
<li>item 1</li>
<li>item 2</li>
</ul>
o Definition List
List of definitions
E.g.
<dl>
<dt>HTML</dt>
<dd>Hyper Text Markup Language</dd>
</dl>
Table
o Contains 3 sections
Header
Body
Footer
o E.g.
<table>
<thead>
<tr>
<th>col1</th>
</tr>
</thead>
<tbody>
<tr>
<td>col1 data </td>
</tr>
</tbody>
<tfoot>
<tr>
<td>summary</td>
</tr>
</tfoot>
</table>
Links (anchor)
o Used to link external file with the page
o
Form
o Used to get input from user
o Elements
textarea:
used to take multi-line input from user
select:
used to create a drop-down list
E.g.
<select>
<option>India</option>
</select>
Input:
used to take input from user
attributes
o maxlength: maximum length of input
o minlength: minimum length of input
o placeholder: hint to the user
o type: decides the type of input
text:
number:
date: dd/MM/yyyy
time: hh:mm a
email:
tel:
radio: option button
checkbox:
submit:
reset:
password:
HTML5 Geo-Location
HTML5 Web Storage
HTML5 Canvas