5th Module HTML

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

5th Module

HTML
➢ WEB BROWSER
A web browser is a software application for retrieving, presenting, and
traversing information resources on the world wide web.
An information resource is identified by a uniform resource identified by a
uniform resource identifier (URI) and may be web page,image, video or other
piece of content.Hyperlinks present in resources enable users to easily
navigate their browsers to related resources.
The primary purpose of a web browser is to bring information resources to the
user.
Browsers are primarily intended to acess the world wide web, they can also be
used to acess information provided by webservers in private network or files
in file systems.
Example of web browsers include Microsoft,Internet explorer,Mozilla firefox,
Google Chrome.
➢ STRUCTURES OF AN HTML DOCUMENT

An HTML documents is composed of three parts:

1.A line containing HTML document type.


2.A declarative header element.
3.A body, which contains the documents actual content
Both the head and the body must be enclosed in <html>…… </html>
• The !DOCTYPE Declaration

A DOCTYPE declaration must be specified on the first line of each


web document. The DOCTYPE tells the web browser which version
of HTML the page is written in. This declaration is made using the
HTML !DOCTYPE tag and is the very first thing in all the
document.This provides the web browser with information about
the type of markup language in which the page is written. It refers
to a known Document type definition or DTD .
The DTD set out the rules and grammar for that flavor of markup,
enabling the browser to render the content accordingly.
The DOCTYPE looks like this

• THE DOCUMENT’S HEAD

An HTML documents head is enclosed by the HTML


<head>….</head> tag.The head element must contain a title
element.This element is used to set the title of the HTML
document,which is commonly displayed by the web browser in
the title bar of the window.
An example of the use of the title element.
<head>
<title>This is the title</title>
</head>
There can only be one title in the header section.
• THE DOCUMENT’S BODY

The body is the container for the visual part of a document. All
things written here will be shown when the document is finally
rendered. Most of the tags in HTML can be inserted in the body
section and will shape the visual aspects of the document. The
body section can include headers ,paragraph, lists, tables and
more.

➢ HTML ELEMENTS

HTML documents are composed of a tree of HTML elements, including


a head and body, headings,paragraph,list,forms,etc.

• ELEMENTS
Elements are the structures that describe parts of an HTML document.
An elements has three parts : a start tag, content and an end tag. A tag is
markup that is denoted by < and >. An end tag includes a “/” after the <.
Elements can also have content , including other elements and text.
HTML tags tell your browser which element to present and how to
present them.Where the element appears is determined by the order in
which the tag appear.
Elements names are always case insensitive.
Elements cannot overlap each other.
Some elements allow the start or end tag to be omitted. For example
the LI tag since the elements end is implied by the next LI element or by
the end of list.
Some elements have no end tag because they have no content. For
example the BR tag for line breaks are represented only by a start tag
and are said to be empty or void elements.

• ATTRIBUTES
Each element can have attributes specified .An elements attributes
define various properties for the element.For example , the IMG element
takes SRC attribute to provide the location of the image and an ALT attribute to
give alternate text for those not loading images.
An attribute is included in the start tag only – never the end tag – and takes
the form:
Attribute-name= Attribute -value
Attribute value is delimited by single or double quote.Attribute names are
case insensitive ,but attribute values may be case sensitive.
➢ STRUCTURAL ELEMENTS
The Structural elements are used to provide structure in a web page,for
instance , indicating sections on a page with a heading , cresting a paragraph
and so on.
The commonly used structural elements are discussed below:
• Body
The body element wraps around all the content that will be
displayed on screen, such as heading ,paragraphs, images, table and so on.
It has some unique attributes, including alink, link, vlink ,text, background,
bgcolour etc.
Syntax: <body alink =” colour”
background= “uri”

bgcolor = “colour”
link =” colour”
vlink= “ colour” >
.
.
</body>
The following are the attributes of the body element:
1. alink(alink= “ colour”) : alink is short for active link.This attributes sets
the active links to a specified colour.This attributes takes as its value a
recognized colour name.
2. background (background = “ uri” ) : The background attribute is used to
display a background image on the webpage
3. bgcolor ( bgcolor = “color” ) : The bgcolor attribute of the body element
provides a mechanism for changing the default background color.
Example: <body bgcolor = “ yellow “ >
.
.
</body>

4. vlink (vlink =” color”) : The vlink attribute stands for visited link .Vlink
attribute specifies the color of the visited link.
Example; This code sets visited links to “ gray”
< body vlink = “ gray “>
.
.
</body>

• br <br>

The <br> tag inserts a single line break.The <br> tag is useful for
writing addresses or poems and it is an empty tag which means
that it has no end tag.

The following is attribute of the br element

Clear ( clear = “{ all|left|none|right }” ) : The clear attribute of br


element is used to clear any pre existing right or left alignment. It
ensures that the content after the br element appears beneath
the baseline of the previously aligned element.

• hr < hr >

The hr element creates in the document a highly visible break


that result as slim horizontal line running in the width of the area
to which it is applied.
The following are the attributes of the hr element

1.Color ( color = “ color “ )

2. noshade ( noshade = “ noshade “ ) : By default , most


browserers display the hr element as a beveled line – an effect
that is uniformly recognized as being slightly ugly.noshade is an
optional attribute that switches the beveled effect off, flattening
the line.

3. size ( size = “ number “) : The size attribute determines the hr


elements height in pixels.

4. width ( width = “ { number | percentage } “ ) : The width


attribute determines the hr elements width in pixels , if no width
is specified, the hr will take up 100% of its containing element.
• h1 to h6 ( <h1>… </h1> to <h6>… </h6> )

The h1 element is used to indicate the most important headind on


the page. In total we have six heading level to choose from h1 to
h6 – to add structures to the web page. h1 is the highest heading
level and h6 the lowest. A documents first heading should be an
h1 , followed by one or more h2 heading.

The following is the attribute of the h1 element

align ( align = “ { left | center | right | justify } “) : The align


attribute affects the text content inside the h1 aligning it to the
left , right or center or setting it to justify on the page.

• head (< head>…..</head>)

The <head> element is a container for metadata (data about data) and
is placed between the <html> tag and the <body> tag.HTML
metadata is data about the HTML document. Metadata is not
displayed.Metadata typically define the document title, character set,
styles, scripts, and other meta information.
• html ( <html>….. </html>

The html is the outer container for everything that appears in an html
document. The <html> tag represents the root of an HTML document.Although
the html element is the outermost element it does not contain the DOCTYPE –
the DOCTYPE must come before the html element.

• p ( < p>….. </p>)

The p element is one of the most commonly used building blocks


of html.When you use the p element to begin a new paragraph in
html it automatically creates some space above and below the
content.

The following are the attributes of the p element :

Align ( align = “ { left | center | right |justify |} “ ) : The align


attribute affects the content of the p, aligning the content to the
left, right or center or setting it to justify on the page

You might also like