unit-2_HTML (2)
unit-2_HTML (2)
HTML
<html>
<head>
<title> </title>
</head>
<body>
</body>
</html>
HTML ELEMENTS
An element of HTML consists of 3 basic parts :
Opening tag
Content tag
Closing tag.
<p>--------------
Element Content
</p>------------
Every webpage requires 4 elements
html element<html>
head element<head>
title element<title>
body element<body>
(i) <html> Element:
It begins & ends each & every webpage.
<html>-----</html>
Its purpose is to encapsulate all the HTML code & describe the
HTML document to the web browser.
(ii) <head> Element:
The head function “behind the scenes”. Tags placed within the
head element are not directly displayed by web browser.
It falls between<html> tag & <body> tag
<title element> is placed inside <head> tag.
Other elements like javascript (scripting language) & CSS
(formatting)also placed within <head> element.
TAGS USED INSIDE<HEAD>
o <title>……..</title>
It will show title at the top of the web browser.
o <! Doctype html 4.0>
It is a comment which tells about html version.
o <link>
It makes a link between an external source &.html file.
o <script language=“javascript”>
o <script type=“text/CSS”>
o <script type=“text/javascript”>
It contains script such as java script or vbscript.
o <meta>
<meta name=“author” content=“MITUjjain”>
It gives the information about web page.
o <base>
It specifies the base URL of the document.
(iii) <title> element
It is used to give title to your web page.
The words written between opening & closing <title> </title> tags
will be displayed at the top of a viewers browser.
(iv) <body> element
The body is where all contents is placed like paragraph, pictures, tables
etc.
It will encapsulate all of your webpage’s viewable content.
HTML TAGS
Every web page is actually a html file.
Each html file is just a plain-text file, but with a .html file
extension instead of .txt.
HTMl file is made up of many HTML as well as the content of
a webpage.
A website will often contain html files that link to each other.
HTML tags are the hidden keywords within a webpage that
define how your web browser must format & display the
content.
Most tags have two parts, an opening part & a closing part,
Ex: <head>---------</head>, <p>---------</p>
Some tags have no closing part.
Example:<img> tag.
Some tags are essential in every HTML file, so that web
browsers can understand it & display it correctly.
The rest of the HTML file can contain any number of tags you
want to use.
Web developer uses the html tags to create the web page & web
browser is used to interpret tags & display the information.
DIFFERENT HTML TAGS
Tags Description
<html>----</html> Declares the web page to be written in
HTML.
<head>-----</head> Defines a header for a document.
<title>----</title> Defines the title of a web page.(seen in
web browser.)
<body>-----</body> Defines the document ‘s body.
<hn>--------</hn> <h1>(large)to<h6> (small)tags are
used to define html headings.
<b>-------</b> Define bold text
<i>-------</i> Define italic text
<center>-------</center> It is used to set the content in to the
center.
<ul>--------</ul> It is used to list the content without
order.
<ol>-----</ol> It is used to list the content in a
particular order.
Tags Description
<li>-----</li> It is used to list the contents.
<br> Forces a line break (single)
<p> Starts a paragraph
<hr> Inserts a horizontal line.
<img src=“----”> Displays an image here
<a href=“-----”>-----</a> Defines hyperlink.
<table> Defines a table.
<!---- > Defines a comment (not visible in
browser)
<marquee>-------</marquee> It is used to scroll the text or image
content.
<font>------</font> It is used to specify the font size, font
color & font in html document.
<link> It is used to link the content from
external source.
<meta> It is used to specify the page
description.
HTML TABLE TAG
HTML forms are used to collect some data from the site visitor.
The HTML<form>------</form> tag is used to create an HTML form.
<input>
<textarea>
<button>
<select>
<option>
<optgroup>
<fieldset>
<label>
accept-charset UTF-8 Specifies the Charset used in the submitted
form(default: the page charset)
action URL Contains a URL that defines where to send the
data after submitting the form
autoComplete On(default) Determines that the browser retains the history of
Off previous values.
novalidate True Specifies that the browser should not validate the
False form.
novalidate attribute: Specifies that the browser should not validate the form.
Value Description
ltr Default, Left-to-right text direction
rtl Right-to-Left text direction.
auto Let the browser figure out the text direction, based
on the content.
Disabled: Disables the input element when it loads on the client side’s web
page, so that the user cannot write text in it or select it. This attribute cannot
be used with type=“hidden”.
form(form_id): specifies form’s id to which the input field belong’s.
formaction: Specifies the URL of the file that will process the input
control when the form is submitted. (input tag attribute).
formmethod attribute: It is an input tag attribute. It defines the HTTP
method for sending data to the action URL.
</datalist>
Field set: This creates a box around the related form
controls.
<fieldset>……..</fieldset>
Label tag: it defines a set of text that is associated with a
particular element.
<label>--------</label>
FRAME IN HTML
• Frame can display one or more than one html document in the
same browser window.
• Each html document is called frame & each frame is independent
of others.
• <frameset> tag is used to display browser window.
• <body> tag is not required in frame tag.
• Attribiutes of frameset tag;
(i) Rows: It divides browser window rowwise.
Example: <html>
<frameset row=“30%,70%”>
</frameset>
</html>
(2) COLS: It divides browser window column wise.
<html>
<frameset cols=“30%,40%,30%”>
</frameset>
</html>
(3) Frame border
(4) Border color
(5) name
HTML Frames Are Used To Divide Your Browser Window
Into Multiple Sections Where Each Section Can Load A
Separate HTML Document.