Unit 1
Unit 1
5
What is an HTML element?
7
HTML <meta> Tag
Describe metadata within an HTML document:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="description" content="Free Web tutorials">
<meta name="keywords" content="HTML,CSS,XML,JavaScript">
<meta name="author" content="John Doe">
<meta name="viewport" content="width=device-width, initial-
scale=1.0">
</head>
<body>
</body>
</html> 8
Section Tag Elements
• The Section tag defines the section of documents
such as chapters, headers, footers, or any other
sections.
12
HTML <video> Tag
• Example,
<video width="320" height="240" controls>
<source src="movie.mp4" type="video/mp4">
</video>
13
HTML <video> Tag
15
HTML <frameset> Tag
each of them.
16
HTML <frameset> Tag
17
HTML <table> Tag Attributes
18
HTML <table> Tag Attributes
rgb(x,x,x)
bgcolor #xxxxxx Specifies the background color for a table
colorname
19
Grouping Content Elements(Grouping tags)
Example
Group related options with <optgroup> tags:
<label for="cars">Choose a car:</label>
<select name="cars" id="cars">
<optgroup label="Swedish Cars">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
</optgroup>
<optgroup label="German Cars">
<option value="mercedes">Mercedes</opt
ion> 20
<option value="audi">Audi</option>
</optgroup>
</select>
Output
21
Linking in HTML
• Syntax
22
Linking in HTML
Value Description
_blank Opens the linked document in a new window or tab
_self Opens the linked document in the same frame as it
was clicked (default)
_parent Opens the linked document in the parent frame
_top Opens the linked document in the full body of the
window
framena Opens the linked document in a named frame
me
23
HTML Background
24
HTML Background with Colors
of an HTML element
• Specifically page body and table backgrounds
• Syntax
<tagname bgcolor="color_value"...>
25
HTML Background with Colors
formats
– <!-- Format 1 - Use color name -->
<table bgcolor="lime" >
– <!-- Format 2 - Use hex value -->
<table bgcolor="#f1f1f1" >
– <!-- Format 3 - Use color value in RGB terms -->
<table bgcolor="rgb(0,0,120)" >
26
HTML Background with Images
page or table
• Syntax
• <tagname background="Image URL"...>
• The most frequntly used image formats are JPEG, GIF
and PNG images
27
HTML Colors
notation
• The lowest value of the light sources is 0 (hex 00) & the
highest value is 255 (hex FF)
29
HTML Formatting Tags
Tag Description
<b> Defines bold text
<em> Defines emphasized text
<i> Defines a part of text in an alternate voice or mood
<small> Defines smaller text
<strong> Defines important text
<sub> Defines subscripted text
<sup> Defines superscripted text
<ins> Defines inserted text
<del> Defines deleted text
<mark> Defines marked/highlighted text 30
HTML Citations, Quotations and Definition Tags
Tag Description
<abbr> Defines an abbreviation or acronym
Defines contact information for the
<address>
author/owner of a document
<bdo> Defines the text direction
<blockquote> Defines a section that is quoted from another
source
<q> Defines an inline (short) quotation
<cite> Defines the title of a work
<dfn> Defines a definition term
31
HTML <font> Tag
• The <font> tag specifies the font face, font size and color
of text
• Example
– <font size="2" color="blue“>Text</font>
– <font face="verdana" color="green“>Text</font>
32
HTML Forms
<form>
:
input elements
:
</form>
33
HTML <input> Tag
34
HTML <input> Tag Attributes
Attribut Value Description
e
audio/*
video/* Specifies the types of files that the
accept
image/* server accepts (only for type="file")
MIME_ty
pe
Left/ right/ Specifies the alignment of an image
align
top/ input (only for type="image")
middle/
bottom
Specifies an alternate text for
alt text
images (only for type="image")
Specifies that an <input> element
checked checked should be pre- selected when the page
loads (for type="checkbox" or
type="radio")
name text Specifies the name of an <input> 35
element
Specifies the width, in characters,
size number
HTML <input> Tag Attributes
control
rows attributes
37
HTML <textarea> Tag
availableValue
Attribute optionsDescription
in the list
disabled disable Specifies that a drop-down list should be
d disabled
multiple multipl Specifies that multiple options can be
e selected at once
name name Defines a name for the drop-down list
size number Defines the number of visible options in a
drop-down list
39
HTML <option> Tag
42