Professional Documents
Culture Documents
HTML Notes For WD Unit I and II
HTML Notes For WD Unit I and II
Unit I and II
● Editors
○Notepad
● IDEs
○ Visual Studio Code (https://code.visualstudio.com/download )
○ Atom (https://atom.io)
○ Adobe Dreamweaver
(https://www.adobe.com/in/products/dreamweaver.html)
● IDEs gives better look and feel to the code using color
schemes and also help in writing code faster
● You can add Live Preview extension in VS Code for live
preview
3
4
5
6
Anatomy of an HTML Element
An HTML element defines the contents to be displayed on the web page
along with instructions to the browser, how to render those contents on
the web page.
7
Structure of HTML Page
8
What is <!doctype html>?
<!doctype html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
9
10
What is Tag?
11
What are different types of tags?
● The tags can be of two types
○ Paired tags
○ Singular tags
● The tags which have opening and closing parts are called
as paired tags e.g.
○ <b></b> is used to make the enclosed text as bold
○ <i></i> is used to make the enclosed text as italic
○ <u></u> is used to make the enclosed text as underline
● The tags which have only opening part but no closing part
are called as singular tags e.g.
○ <img> tag
○ <br> tag
12
Tags under <head> section
● The head section contains some sub tags which do not show
the content on the web page e.g.
<title></title> tag
<script></script> tag
<style></style> tag
<meta> tag
<bgsound> tag
<link> tag
13
Tags under <body> section
15
16
What are the heading tags?
17
18
19
What are the attributes?
For example,
All the heading tags have align attribute to align the text
as left, right or center
20
21
22
What are various text formatting tags in HTML?
HTML provides many text formatting tags, some important ones are
HTML provides <a></a> also known as anchor tag to create the hyperlinks
with some attributes
● href='url’
● title=’some text’
● target='_blank'
Note: URL stands for Uniform Resource Locator. It is the path to reach
some resource like image, video etc. Here href stands for hyper reference
which means reference of the resource which you want to link. Here
target='_blank' opens the given URL in new window or new tab.
26
27
What is anchor?
28
Exercise 1
29
How to show an image on a web page?
HTML provides <img> tag to insert an image into the webpage
using following attributes
● src='source file name'
● width='x'
● height='y'
● alt='alternate text'
● title='image title'
The <video></video> tag provides a sub tag called <source> to define the video
source file to be displayed with its format using attributes
● src='filename'
● type='video format type'
Note: The video format type can be video/mp4, video/webm and video/ogg
32
https://github.com/drbpsharma/placement.2.0.html/blob/master/video.mp4
33
34
How to show youtube video on your web page?
35
https://www.youtube.com/watch?v=tgbNymZ7vqY 36
37
How to use audio files?
Example:
<audio controls>
<source src="song.mp3" type="audio/mpeg">
</audio>
38
What is list?
39
What is Ordered List?
40
What is Un-ordered List?
41
What is Description List?
42
Example
43
44
Creating Tables
45
46
47
Global Attributes
48
•text/plain
49
Creating Form Elements
● <label></label> tag
○ Used to define the label for an input element
○ Attribute
■ for='element id'
50
Creating Form Elements
● <input> tag
○ Used to create various types of controls
○ type='text | password | checkbox | radio | file | button |
submit | reset | hidden | date | time | datetime | number |
email | url | range‘
○ placeholder='water mark text‘
○ required
○ autofocus
○ checked
○ size='n'
○ maxlength='n‘
○ value='any value‘
○ min
○ max 51
Creating Form Elements
52
Creating Form Elements
53