0% found this document useful (0 votes)
38 views

Introduction To HTML

HTML is a markup language used to define the structure and layout of web pages. It uses tags to annotate text and other content to indicate how it should be displayed. Some key HTML tags include <html> to define an HTML document, <head> for metadata, <body> for content, and <a> for hyperlinks. HTML provides basic building blocks for creating websites and web pages.

Uploaded by

sarikasshah
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views

Introduction To HTML

HTML is a markup language used to define the structure and layout of web pages. It uses tags to annotate text and other content to indicate how it should be displayed. Some key HTML tags include <html> to define an HTML document, <head> for metadata, <body> for content, and <a> for hyperlinks. HTML provides basic building blocks for creating websites and web pages.

Uploaded by

sarikasshah
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 37

Introduction to HTML

SARIKA SHAH
 HTML is a language for describing web pages.
 HTML stands for Hyper Text Markup Language
 HTML is not a programming language, it is a markup
language
Introduction to HTML
…details

 HTML (Hypertext Markup Language) is used to create document on the World


Wide Web. It is simply a collection of certain key words called ‘Tags’ that are
helpful in writing the document to be displayed using a browser on Internet.
It is a platform independent language that can be used on
any platform such as Windows, Linux, Macintosh, and so on. To display a
document in web it is essential to mark-up the different e l eme n t s ( h e a d i n
g s , p a r a g r a p h s , t a b l e s , a n d s o o n ) o f t h e document with
the HTML tags. To view a mark-up document u s e r h a s t o o p e n t h e d
o c u m e n t i n a b r o w s e r . A b r o w s e r understands and interpret the
HTML tags, identifies the structure of the document (which part are which) and
makes decision about presentation (how the parts look) of the document.
HTML also provides tags to make the document look attractive using graphics,
font size and colors. User can make a link to the other document or the different
section of the same document by creating Hypertext Links also known as
Hyperlinks
HTML TOOLS

 There are two tools of HTML.


a) HTML Editor: it is the program that one uses to create and save
HTML documents. They fall into two categories:
- Text based or code based which allows one to see the HTML code as
one is creating a document.e.g. Notepad.
 Web Browser: it is the program that one uses to view and test the
HTML documents. They translate Html encoded files into
text,image,sounds and other features user see. Microsoft Internet
Explorer,Netscape,Mosaic Chrome are examples of browsers that
enables user to view text and images and many more other World
Wide Web featueres.They are software that must be installed on user
computer.
HTML Templates

 The essential tags that are required to create a HTML


document are:
 <HTML>.............</HTML>
 <HEAD>.............</HEAD>
 <BODY>.............</BODY>
HTML TERMINOLGY

 Some commonly used terms in HTML are:


 a)Tag: Tags are always written within angles brackets. it is a piece
of text is used to identify an element so that the browser realizes
how to display its contents.e.g.<HTML> tag indicates the start of
an HTML document .HTML tag can be two types. They are:-
 -Paired Tags :A tag is said to be a paired tag if text is placed
between a tag and its companions tag.In paired tag ,the first tag is
referred to as opening tag and the second tag is referred to as
closing tag.
 -Unpaired Tags: An unpaired tag does not have a companion
tag .unpaired tag also known as singular or Stand-Alone
tags.e.g:<br>,<hr> etc.
HTML Tag

 The <HTML> tag encloses all other HTML tags and associated
text within your document. It is an optional tag. You can create an
HTML document that omits these tags, and your browser can still
read it and display it. But it is always a good form to include the
start and stop tags.The format is:
 <HTML>
Your Title and Document (contains text with HTML tags) goes here
 </HTML>
Most HTML tags have two parts, an opening tag and closing tag. The
closing tag is the same as the opening tag, except for the slash
mark e.g. </HTML>. The slash mark is always used in closing tags.
An HTML document has two distinct parts HEAD and BODY

 <HTML>
 <HEAD>
 .............
 .............
 .............
 </HEAD>
 <BODY>
 .............
 .............
 .............
 </BODY>
 </HTML>
HEAD Tag <HEAD>

 HEAD tag comes after the HTML start tag. It contains TITLE
tag to give the document a title that displays on the browsers
title bar at the top. The Format is:
<HEAD>
<TITLE>
Your title goes here
</TITLE>
</HEAD>
BODY Tag <BODY>

 The BODY tag contains all the text and graphics of the document with all the
HTML tags that are used for control and formatting of the page.The Format is:

<BODY>
Your Document goes here
</BODY>

An HTML document, web page can be created using a text editor,


Notepad or WordPad. All the HTML documents should have the
extension .htm or html. It require a web browser like Internet
Explorer or Netscape Navigator/Communicator to view the
document.
Follow the steps to create and view in browser

 Step-1: O p e n t e x t e d i t o r Notepad (click on Star t→ A l l


Programs→ Accessories Notepad)
 Step-2: Enter the following lines of code:
<HTML>
<HEAD>
<TITLE>
My first Page
</TITLE>
</HEAD>
<BODY>
WELCOME TO MY FIRST WEB PAGE
</BODY>
</HTML>
S A V I N G A N D V I E W I N G A H T M L DOCUMENT

 Step-3: Save the file as myfirstpage.html (go to File-Save As


give File name: myfirstpage.html-choose save as type: All
Files-click save)
 Step-4: Viewing document in web browser (open Internet
Explorer-click on File-Open-Browse-select the file
myfirstpage.html-click open-click ok
Basic Tags
 <H1> </H1> <H2> </H2> ... <H6> </H6>
 Headings (levels 1-6, i.e. H3 is a subheading within a H2
subheading). H1, H2,... tags are used to create titles. Why do we
need titles, when we can style a text to look like H tags? For
instance, titles are used so that search engines and other scrapers
(bots) understand the important parts of our documents.

 <P> </P>
 The paragraph tag groups text into a paragraph :D (That is funny).
Hence its purpose is to separate a part of text or paragraph, this
way you make it more readable and organized..
The most common character formatting tags are

 Boldface <B>: displays text in BOLD


Example: Welcome to the <B> Internet World </B>
Output: Welcome to the Internet World
 Italics <I>: displays text in Italic
Example: Welcome to the <I> Internet World </I>
Output: Welcome to the Internet World
 Subscript <SUB>: displays text in Subscript
 Superscript <SUP>: displays text in Superscript
 Small <SMALL>: displays text in smaller font as compared to normal font
 Big <BIG>: displays text in larger font as compared to normal font
 Underline<U>specifies that the enclosed text be underline
Example:<U> hello</u>
Output: hello
 <br> Tag: br stands for break line, it breaks the line of the
code.
 <hr> Tag: hr stands for Horizontal Rule. This tag is used to
put a line across the webpage.
 em> - Emphasized text
 <mark> - Marked text
 <small> - Smaller text
 <del> - Deleted text
<HR> accepts following attributes

 SIZE: Determines the thickness of the horizontal rule. The value is given as a pixel value.
Example: <HR SIZE="3">
 WIDTH: Specifies an exact width of HR in pixels, or arelative width as percentage of the
document width.
Example: <HR WIDTH="50%">, horizontal rule a width a 50 percent of the page width.
 ALIGN: Set the alignment of the rule to LEFT, RIGHT and CENTER. It is applicable if it is
not equal to width of the page.
 NOSHADE: If a solid bar is required, this attribute is used; it specifies that the horizontal
rule should not be shaded at all.
 COLOR: Set the color of the Horizontal rule.
Example: <HR COLOR="BLUE“>
Example of <HR> with its attribute:
<HR ALIGN=' 'CENTER' ' WIDTH=' '50%' ' SIZE=' '3" NOSHADE
COLOR="BLUE“>
<Pre> Tag

 The <pre> tag in HTML is used to define the block of


preformatted text which preserves the text spaces, line
breaks, tabs, and other formatting characters which are ignored
by web browsers. Text in the <pre> element is displayed in a
fixed-width font, but it can be changed using CSS. The <pre>
tag requires a starting and end tag.
SPECIAL CHARTACTER

 There are certain special characters that can be used while


creating document.Following are some special character:
 Symbols Entity
©, ® &copy, &reg
¼, ½, ¾ &frac14, &frac12, &frac34
÷, <, >, ≤,≥ &divide, &lt, &gt, &le, &ge
& &amp
♣♠♥ &spades, &clubs, &hearts
All these special character must be ended with a semicolon;
HTML Lists: Types and Uses

 HTML lists are a way of organizing and presenting


information on a web page using different types of markers or
numbers.

HTML LIST

Descriptive Ordered Unordered


Description List

 A description list is a list of terms, with a description of each


term.
 The HTML description list is used to represent data in the
name-value form.
 The <dl> tag defines the description list,
 The <dt> tag defines the term name, and the <dd> tag
describes each term.
Unordered List

 The HTML Unordered List: An unordered list starts with the


“ul” tag. Each list item starts with the “li” tag. The list items
are marked with bullets i.e small black circles by default.
Ordered List

 Attributes:
 compact: It defines the list should be compacted (compact
attribute is not supported in HTML5. Use CSS instead.).
 reversed: It defines that the order will be descending.
 start: It defines from which number or alphabet the order will
start.
 type: It defines which type(1, A, a, I, and i) of the order you
want in your list of numeric, alphabetic, or roman numbers.
Anchor Tag

 The HTML anchor tag defines a hyperlink that links one page
to another page. It can create hyperlink to other web page as
well as files, location, or any URL. The "href" attribute is the
most important attribute of the HTML a tag. and which links to
destination page or URL.
 Links in browsers usually follow these conventions:
 Unvisited links: Underlined and blue.
 Visited links: Underlined and purple.
 Active links: Underlined and red.
Syntax of Anchor Tag
attribute of Anchor tag

 “Href” stands for “hypertext reference.” It states the resource the <a> tag
should link to. Target
 _blank: this is the most used option. You can open the linked page on a new
window/tab by setting the target attribute value as _blank.
 _self: this is the default value. It helps open the linked page in the same
window frame.
 _top: this opens the linked page in the top window.
 _parent: this opens the linked page in the parent frame.
 Name: This tag enables users to jump to specific sections of a web
document. This tag is especially useful for navigating across large pages
 The title attribute shall give you an indication of the final, targeted
destination. If you hover over the link with your mouse, you can see the title
displayed.
Anchor Tag

 What are Absolute URLs?


 An absolute URL contains the entire address from the protocol
(HTTPS) to the domain name (www.example.com) and
includes the location within your website in your folder system
(/foldernameA or /foldernameB) names within the URL.
 Basically, it's the full URL of the page that you link to.
 An example of an absolute URL is:
 <a href = http://www.example.com/xyz.html>
 What are Relative URLs?
 The relative URL, on the other hand, does not use the full web
address and only contains the location following the domain. It
assumes that the link you add is on the same site and is part of
the same root domain.
 The relative path starts with the forward slash and leads the
browser to stay within the current site.

An example of a relative URL is:


 <a href = "/xyz.html">
IMG Tag in HTML

 HTML img tag is used to display image on the web page.


HTML img tag is an empty tag that contains attributes only,
closing tags are not used in HTML image element.

Images not only improve look and feel of a website, but also
convey information in the form of graphics. We usually forget text
but visuals are stored deeply inside our brain.
Images not only enhance the look and feel of a website, they add
information in the form of pictures. We can uses images as
a logo, banner, icons, symbols, product etc.
HTML Images Formats and
Comparison

 Html supports many popular images extensions, i.e jpg, png, gif, svg and
webp. Here is a comparison between jpg, png, gif, svg and webp.

Extension Full Form Type Use


jpg Joint Photographic Expert Raster banner, background, product images
Group without transparency

png Portable Network Graphics Raster pictures with transparency

gif Graphic Interchange format Raster animated picture with motions

svg scalar vector graphics Vector logos, icons, animations.

webp Web Picture Raster jpg and png replacement with 25-34%
compression
Attributes of IMG Tag

 src: It is used to specify the path to the image.


 alt: It is used to specify an alternate text for the image. It is
useful as it informs the user about what the image means and
also due to any network issue if the image cannot be displayed
then this alternate text will be displayed.
 height: It is used to specify the height of the image.
 width: It is used to specify the width of the image.
 ismap: It is used to specify an image as a server-side image
map.
 usemap: It is used to specify an image as a client-side image
map.
 HTML5 introduced the <figure> and <figcaption> elements to
help with this. You wrap the <img> tag inside a <figure>
element, and you specify a caption within the <figcaption>
element.
 This helps search engines associate the caption with the image,
leading to better performance and SEO.
 <figure>
 <img
 src="assets/images/ring-tailed-lemurs.webp"
 alt="A Group of Ring-tailed Lemurs"
 title="Ring-tailed lemurs are led by females"
 loading="lazy"
 />
 <figcaption>Ring-tailed lemures are social animals</figcaption>
 </figure>
Video tag in html

 The HTML5 <video> tag displays a video player in the


webpage with customized controls.

Video File Format MediaHTML


Type Video Formats
.mp4 Video/mp4
.ogg video/ogg
.webM video/webM
Attributes in Video Tag

 Video Tag: It is a paired tag and all the code regarding video will be written inside this. It
displays a video player in the webpage.
 'height' and 'width' attribute: These attributes specify the size of the player.
 'controls' attribute: It adds video controls in the player like play, pause and volume.
 <source> tag: It specifies the characteristics of the video to be added like its location(URL)
and type. You can add multiple source tag inside the same video tag to add the video file
with different video type. The browser will play the first supported video type.
 'src' attribute: This attribute is an alternative for <source> tag. If you want to add a single
type video file then use this attribute inside video tag. It is also used inside source tag to add
location of video file.
 'type' attribute: It specifies the type of the video file.
 Autoplay: The autoplay attribute automatically plays the video.
 Loop:The loop attribute specifies that the video will automatically play the video from
the beginning once it ends
 Muted: The muted attribute sets the volume of the video to 0
 Poster:The poster attribute specifies a link to an image to be shown when the video has
not been played or is still downloading.

You might also like