Sie sind auf Seite 1von 13

IIT Bombay

Computer Programming
Dr. Deepak B Phatak
Dr. Supratik Chakraborty
Department of Computer Science and Engineering
IIT Bombay

Session: HTML (Hyper Text Markup Language)


Recap
IIT Bombay

• Networks and Protocols


Overview of This Lecture
IIT Bombay

• Introduction to HTML
• Simple HTML tags

For more Information


https://
en.wikibooks.org/wiki/HyperText_Markup_Language
We wish to create a page … IIT Bombay
HTML
IIT Bombay

• Hyper Text Mark Up Language


• “Marking Up”
• Old Copyediting Term
• Mark up the document with special tags
to specify, Fonts, Margins, Paragraph
Breaks, …
• Describe The “Look” (Rendering)
HTML
IIT Bombay

• Explicit Formatting Commands


• Embedded Within The Document
• Browser is an Interpreter
• Interprets HTML Tags
• Can Handle Tables, Formulae
• Advanced Style Sheets
Tags in HTML
IIT Bombay

• Pair of Tags Affect The Contents


Enclosed
• <tag> …. </tag>
• Document Enclosed Within
• <html> .. </html>
• Two Parts : Head and Body
• <head> <title> Title </title> </head>
• <body> .. </body>
Structure of HTML Page
IIT Bombay

<html>
<head>
<title>
Title of the Page
</title>
</head>
<body>
…..
</body>
</html>
Tag Attributes
IIT Bombay

• Tags may or may not have attributes


• Defines a tag by giving more information
• An attribute contains a value

<tag name=“value”> … </tag>


HTML Tags
IIT Bombay

• <hn> … </hn>: Delimits Level ‘n’ Heading (1 to 6)


• <b> .. </b>: Bold face
• <i> … </i>: Italic face
• <u> … </u>: Underline text
• <div style=“color:red”> … </div>: Sets a red font
color
• <br />: Line break
• <p> … </p>: Paragraph
Simple HTML Page
<html> IIT Bombay

<head>
<title> Title </title>
</head>
<body>
<h1 style="color:red"> Simple HTML Page</h1>
<div style="color:blue">
<b>Hello World !</b> <br />
This is our <i>first <u>HTML page.</u></i> <br />
</div>
<div style="color:green">
<pre><b><i> <br /><br />Hope this session gets you going...
</i></b></pre>
</div>
</body>
</html>
Simple HTML Page (myFirstHTML.html)
IIT Bombay

<html>
<head>
<title> Title </title>
</head>
<body>
<h1 style="color:red"> Simple HTML
Page</h1>
<div style="color:blue">
<b>Hello World !</b> <br />
This is our <i>first <u>HTML
page.</u></i> <br />
</div>
<div style="color:green">
<pre><b><i> <br /><br />
Hope this session gets you going...
</i></b></pre>
Fig: Output
</div>
</body>
Summary
IIT Bombay

• Introduced HTML
• Examined some basic tags

For more Information


https://en.wikibooks.org/wiki/HyperText_Markup_Languag

Das könnte Ihnen auch gefallen