Introduction To HTML
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
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>
<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
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
HTML 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
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.
webp Web Picture Raster jpg and png replacement with 25-34%
compression
Attributes of IMG 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.