HTML
HTML
LANGUAGE
WHAT IS HTML?
HTML is the standard markup language for
creating Web pages.
Example Explained
<!DOCTYPE html>
The <!DOCTYPE html> declaration
<html> defines this document to be HTML5
<body>
The <title> element specifies a title for
the document
<h1>My First Heading</h1>
The <body> element contains the
visible page content
<p>My first paragraph.</p>
</body>
The <h1> element defines a large
heading
The <p> element defines a paragraph
</html>
HTML TAGS
Note: Only the content inside the <body> section (the white
area above) is displayed in a browser.
WRITE HTML USING NOTEPAD
HTML ATTRIBUTES
Output:
HTML PARAGRAPHS
Output:
This is a paragraph.
This is another paragraph.
HTML Rules (Lines)
We use <hr /> tag to create horizontal line.
HTML Styles
HTML STYLE
HTML STYLE
HTML STYLE
HTML DIVISION (DIV)
The <div> element defines logical divisions within the document. When
you use a <div> element, you are indicating that the enclosed content is
specific section of the page and you can format the section with CSS
(Cascading Style Sheet). For example,
HTML TEXT FORMATTING
HTML TEXT FORMATTING
<b>This text is bold</b>
<p>This
is <sub>subscripted</sub> text.</p>
HTML TEXT FORMATTING
<p>This
is <sup>superscripted</sup> text.</p>
<h2>HTML <small>Small</
small> Formatting</h2>
HTML SPACING
Pre tag
The <pre> tag defines preformatted text
HTML SPACING
The <br> tag inserts a single line break.
The <br> tag is an empty tag which means
<strong>Strong text</strong>
<p><tt>Teletype text</tt></p>
default:
UNORDERED HTML LIST
Example:
<ul type="disc">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
ORDERED HTML LIST
An ordered list starts with the <ol> tag. Each list item starts
with the <li> tag.
The list items will be marked with numbers by default:
ORDERED HTML LIST
<ol type="1">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
HTML DESCRIPTION LISTS
<table border="1">
<tr>
<th>Heading</th>
<th>Another Heading</th>
</tr>
<tr>
<td>row 1, cell 1</td>
<td>row 1, cell 2</td>
</tr>
<tr>
<td>row 2, cell 1</td>
<td>row 2, cell 2</td>
</tr>
</table>
HTML TABLE - CELLS THAT SPAN MANY
COLUMNS
To make a cell span more than one column, use
the colspan attribute:
<table style="width:100%">
<tr>
<th>Name</th>
<th colspan="2">Telephone</th>
</tr>
<tr>
<td>Bill Gates</td>
<td>55577854</td>
<td>55577855</td>
</tr>
</table>
HTML TABLE - CELLS THAT SPAN MANY ROWS
<table style="width:100%">
<tr>
<th>Name:</th>
<td>Bill Gates</td>
</tr>
<tr>
<th rowspan="2">Telephone:</th>
<td>55577854</td>
</tr>
<tr>
<td>55577855</td>
</tr>
</table>
HTML FRAMES
We can use frames to display more than one web page in the same
browser window. Each HTML document is called a frame, and
each frame is independent of the others.
<frameset cols="25%,*,25%">
<frame src="frame_a.htm">
<frame src="frame_b.htm">
<frame src="frame_c.htm">
</frameset>
</html>
THE <FORM> ELEMENT
form elements
</form>
An HTML form contains form elements.
Type Description
<form>
First name:<br>
<input type="text" name="firstname">
<br>
Last name:<br>
<input type="text" name="lastname">
</form>
RADIO BUTTON INPUT
<form>
<input type="radio" name="gender" value="male" checked> Male<br>
<input type="radio" name="gender" value="female"> Female<br>
<input type="radio" name="gender" value="other"> Other
</form>
THE <SELECT> ELEMENT
For example,
<form name="input" action=" submit.php" method="get">
Username:
<input type="text" name="user" />
<input type="submit" value="Submit" />
</form>
THE METHOD ATTRIBUTE
Here are the different Input types you can use in HTML:
<input type="image">
<input type="month">
<input type="button">
<input type="number">
<input type="checkbox"> <input type="password">
<input type="color"> <input type="radio">
<input type="date"> <input type="range">
<input type="reset">
<input type="datetime- <input type="search">
local"> <input type="submit">
<input type="email"> <input type="tel">
<input type="file"> <input type="text">
<input type="time">
<input type="hidden">
<input type="url">
<input type="week">
HTML INPUT TYPES
Input Type Text
Input Type Submit
<form>
User name:<br>
<input type="text" name="username"><br>
User password:<br>
<input type="password" name="psw">
</form>
HTML INPUT TYPES
Input Type Reset
<input type="reset"> defines a reset
<form action="/action_page.php">
<input type="checkbox" name="vehicle1" value="Bike">I have a bike
<br>
<input type="checkbox" name="vehicle2" value="Car">I have a car
<br><br>
<input type="submit">
</form>
HTML INPUT ATTRIBUTES
<form action="">
First name:<br>
<input type="text" name="firstname" value="John" readonly
>
</form>
<form action="">
First name:<br>
<input type="text" name="firstname" value="John" size="40
">
</form>
HTML THE ID ATTRIBUTE
The <video> tag specifies video, such as a movie clip or other video
streams.
<video width="320" height="240" controls>
<source src="movie.mp4" type="video/mp4">
<source src="movie.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>