HyperText Markup Language (HTML). Introduction to HTML Hyper Text Markup Language HTML Example The...

22
HyperText Markup Language (HTML)

Transcript of HyperText Markup Language (HTML). Introduction to HTML Hyper Text Markup Language HTML Example The...

Page 1: HyperText Markup Language (HTML). Introduction to HTML Hyper Text Markup Language HTML Example The structure of an HTML document Agenda.

HyperText Markup Language(HTML)

Page 2: HyperText Markup Language (HTML). Introduction to HTML Hyper Text Markup Language HTML Example The structure of an HTML document Agenda.

Introduction to HTML

• Hyper Text Markup Language

• HTML Example

• The structure of an HTML document

Agenda

Page 3: HyperText Markup Language (HTML). Introduction to HTML Hyper Text Markup Language HTML Example The structure of an HTML document Agenda.

Introduction to HTML

• The World wide web -The set of computers on internet that supports HTTP

• Web Server The special software that allows the website management Accepts client request for information Responds to the client request by providing the page with the

required information

• Web Client A special software also known as browser that allows Connecting to the appropriate server Query the server for the information to be read Provide the interface to read the information returned by the server

• HTTP -The Hypertext Transfer Protocol The language used by the www client(eg. Netscape, Internet

Explore, Firefox etc.) to request the documents from the www server(i.e. program running at the websites)

Page 4: HyperText Markup Language (HTML). Introduction to HTML Hyper Text Markup Language HTML Example The structure of an HTML document Agenda.

Hyper Text Markup Language

Text Mixed with markup tags - Tags enclosed in angled brackets ( <h1> Heading</h1>)The language interpreted by the browserWeb Pages are also know as the HTML

documentsWhat does markup describe -Appearance -Layout -Content

Page 5: HyperText Markup Language (HTML). Introduction to HTML Hyper Text Markup Language HTML Example The structure of an HTML document Agenda.

HTML Example

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html> <head> <title>WebMail</title> <LINK rel="stylesheet" type="text/css" href="/twig/styles/classic/basic.css"> </head> <body> <div class="twigheader"> <div align="center“> <img src="/twig/images/top.jpg" alt="[WebMail]"> </div> </div> <hr> <form action="/twig/index.php" method="POST" name="login_form">

<div> <center> <table border=1><tr><td> <table border=0 cellspacing=0> <tr> <td colspan=2 class="tabletitle"> <b>Please enter your user information</b> </td> </tr> <tr> <td align="right"> Username: </td> <td> <input name="login_username"> </td> </tr> <tr> <td align="right"> Password: </td> <td> <input name="login_password" type="password"> </td>

</tr> <tr> <td colspan=2 align="center"> <HR> <input type="submit" name="set_twig_authenticated"

value="Log In"> </td> </tr> </table> </td></tr></table> </center> </div> </form><hr> <div class="twigfooter"> </div> </body> </html>

Page 6: HyperText Markup Language (HTML). Introduction to HTML Hyper Text Markup Language HTML Example The structure of an HTML document Agenda.

The structure of an HTML document

• DOCTYPE

• Document Head

• Document Body

• Titles and Footers

• Text Formatting

• Line Breaks

• Text Styles

Page 7: HyperText Markup Language (HTML). Introduction to HTML Hyper Text Markup Language HTML Example The structure of an HTML document Agenda.

DOCTYPE

• Doctype declaration is the very first thing in the HTML document before <html> tag.

• This tag tells the browser which HTML or XHTML specification the document uses

example- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML

4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

Page 8: HyperText Markup Language (HTML). Introduction to HTML Hyper Text Markup Language HTML Example The structure of an HTML document Agenda.

Document Head

• Information placed in this section is essential for the inner working of the document and has nothing to do with the content of the document

• With the exception of the information placed in the <title></title> ,all other information will not be visible in the <head></head>tags is not dispalyed in the browser.

• example <html> <head> <title>First app</title> </head> <body> …. </body> </html>

Page 9: HyperText Markup Language (HTML). Introduction to HTML Hyper Text Markup Language HTML Example The structure of an HTML document Agenda.

Document Body

• The tags used to indicate the start and end of the main body of the textual information

<body> …… <body>

page default like background color, text color, font size and font weight can be specified as the attribute of the <body> tag

Page 10: HyperText Markup Language (HTML). Introduction to HTML Hyper Text Markup Language HTML Example The structure of an HTML document Agenda.

Titles and Footers

• Title -Describes what page is all about without being too wordy -The text included in the <title></title>shows up in the title bar of the browser

window <title>….The Message ….</title>

• Footer -Information commonly placed in the foot of the webpage. Generally hold copyright

information, contact details of the creator of the webpage and so on. <address>the text</address>

Example

<head><title>This is the title</title></head> <body> <address> This is the footer</address> </body>

Page 11: HyperText Markup Language (HTML). Introduction to HTML Hyper Text Markup Language HTML Example The structure of an HTML document Agenda.

Text Formatting

• The blank line always separate paragraphs in textual information. The tag that provide this functionality is <p>.

Example

<html> <head> <title>First app</title> </head> <body> firest paragraph 1........this is tha sample text <p>this is the second paragraph...this is the sample text </body> </html>

Page 12: HyperText Markup Language (HTML). Introduction to HTML Hyper Text Markup Language HTML Example The structure of an HTML document Agenda.

Line Breaks

• Use when the text need to be started from the new line and not from the same line the <br> tag is used.

• Example

<html> <head> <title>First app</title> </head> <body> firest paragraph 1........this is tha sample text<br>this is the second

paragraph...this is the sample text </body> </html>

Page 13: HyperText Markup Language (HTML). Introduction to HTML Hyper Text Markup Language HTML Example The structure of an HTML document Agenda.

Text Styles

• Bold Displays the text in the BOLDFACE style. The tag used are<b>….</b>

• Italics Displays text in ITALICS. The tags used in this case are<i>…..</i>

• Underline Displays the text as underlined. The tags used in this case are <u>…</u>

• Example

<html> <head> <title>First app</title> </head> <body> <b>firest paragraph 1........this is tha sample text</b><br>

<i>this is the second paragraph...this is the sample text</i><br> <u>third linr...underlined</u>

</body> </html>

Page 14: HyperText Markup Language (HTML). Introduction to HTML Hyper Text Markup Language HTML Example The structure of an HTML document Agenda.

Lists

• Types of list -Unordered List <ul></ul>

-Ordered List <ol></ol>

Each list item starts with <li>

Type -Specifies the type of bulletType=fillround gives solid round black bulletType=square gives solid square black bullet

Type=“1” will give counting numbers (1,2…)Type=“A” will give uppercase letters (A,B…)Type=“a” will give lowercase letters (a,b….)Type=“I” will give uppercase Roman Numbers (I,II,III….)Type=“I” will give lowercase Roman Numbers (I,II,III….)Start used to alter the numbering sequence.

Page 15: HyperText Markup Language (HTML). Introduction to HTML Hyper Text Markup Language HTML Example The structure of an HTML document Agenda.

OL Ordered (Numbered) List & Unordered List

• <OL> Element• Example

-<ol type=“I”> <li>First Element <li>Second Element <li>Third Element </ol>

Attributes –type, Start, value

• List Entries: LI

<li>…</li> End Tag Optional

• <UL> Element • Example

-<ul type=“square”> <li>First Element <li>Second Element <li>Third Element </ul>

Page 16: HyperText Markup Language (HTML). Introduction to HTML Hyper Text Markup Language HTML Example The structure of an HTML document Agenda.

Definition List

Is not list of itemsList of terms and explanation of termsExample <dl> <dt>Coffee</dt> <dd>Black hot drink</dd> <dt>Milk</dt> <dd>White cold drink</dd> </dl> OUTPUT

Definition list starts with <dd> tag Definition list term starts with <dt>tag Definition list definition starts with <dd>tag

Page 17: HyperText Markup Language (HTML). Introduction to HTML Hyper Text Markup Language HTML Example The structure of an HTML document Agenda.

Displaying Images

• Images are defined with <img> tag

• <img> tag is empty <img src="url"> src stands for source url points to the location where image is stored

<img src=“cdac.gif” alt=“C-DAC Hyderabad”>

alt attributes are used to define alternate text for the image

Page 18: HyperText Markup Language (HTML). Introduction to HTML Hyper Text Markup Language HTML Example The structure of an HTML document Agenda.

Table

Defined with <table> tag

table is divided into rows (with the <tr> tag>)

and each row is divided into data cells( with <td> tags. Td

stands for table data.

Example

Table Attributes

border

cellspacing

cellpadding

etc

<table border=1><tr><td>First row first cell</td><td>First row second cell</td></tr><tr><td>Second row first cell</td><td>Second row second cell</td></tr></table>

Page 19: HyperText Markup Language (HTML). Introduction to HTML Hyper Text Markup Language HTML Example The structure of an HTML document Agenda.

HTML Links

Uses <a> (anchor) tag and href attribute to link to the another elements

Can point to any resource on the web Example <a href=“http://indg.in”>India Development

Gateway</a>

Target Attribute defines where the link will be opened <a href=“http://indg.in” tagret=“_blank”>India Development Gateway</a>

Here target=“_blank” specifies that document will open in new window

Page 20: HyperText Markup Language (HTML). Introduction to HTML Hyper Text Markup Language HTML Example The structure of an HTML document Agenda.

Anchor Tag and name Attribute

• Name attribute is used to create named anchor used to jump to specific location in the webpage

Example <a name=“anchor1”> <a href=“#anchor1”>go to anchor1</a>

Page 21: HyperText Markup Language (HTML). Introduction to HTML Hyper Text Markup Language HTML Example The structure of an HTML document Agenda.

HTML frames

• Use to display more than one HTML document in the same browser window

• Uses <frameset> tag defines how to divide window into frames

Page 22: HyperText Markup Language (HTML). Introduction to HTML Hyper Text Markup Language HTML Example The structure of an HTML document Agenda.

Thank You……………