+ All Categories
Home > Documents > HTML Hyper Text Markup Language It is used for describing web documents or web pages. A markup...

HTML Hyper Text Markup Language It is used for describing web documents or web pages. A markup...

Date post: 29-Dec-2015
Category:
Upload: opal-bishop
View: 234 times
Download: 5 times
Share this document with a friend
Popular Tags:
38
HTML • Hyper Text Markup Language • It is used for describing web documents or web pages. • A markup language is set of markup tags. • HTML documents are described by HTML tags. • Each HTML tag describes different HTML content.
Transcript
Page 1: HTML Hyper Text Markup Language It is used for describing web documents or web pages. A markup language is set of markup tags. HTML documents are described.

HTML

• Hyper Text Markup Language• It is used for describing web documents or

web pages.• A markup language is set of markup tags.• HTML documents are described by HTML tags.• Each HTML tag describes different HTML

content.

Page 2: HTML Hyper Text Markup Language It is used for describing web documents or web pages. A markup language is set of markup tags. HTML documents are described.

HTML

• An HTML file must have an .htm or .html file extension

• HTML files can be created with text editors:– NotePad, NotePad ++, PSPad

• Or HTML editors:– Microsoft FrontPage– Macromedia Dreamweaver– Netscape Composer– Microsoft Word– Visual Studio

Page 3: HTML Hyper Text Markup Language It is used for describing web documents or web pages. A markup language is set of markup tags. HTML documents are described.

HTML Example

Page 4: HTML Hyper Text Markup Language It is used for describing web documents or web pages. A markup language is set of markup tags. HTML documents are described.

HTML Example

Page 5: HTML Hyper Text Markup Language It is used for describing web documents or web pages. A markup language is set of markup tags. HTML documents are described.

HTML Versions

Page 6: HTML Hyper Text Markup Language It is used for describing web documents or web pages. A markup language is set of markup tags. HTML documents are described.

Some Simple Tags• Hyperlink Tags<a href="http://www.google.com/">Link to google Web site</a>• Image Tags<img src="logo.gif" alt="logo" />• Text formatting tags• This text is <em>emphasized.</em>• <br />new line<br />• This one is• <strong> more emphasized </strong>

Page 7: HTML Hyper Text Markup Language It is used for describing web documents or web pages. A markup language is set of markup tags. HTML documents are described.

Some Simple Tags Example• <!DOCTYPE HTML>• <html>• <head>• <title>Simple Tags Demo</title>• </head>• <body>• <a href="http://www.google.com/">This is a link

</a>• <br />• <img src="logo.gif" alt="logo" />• <br />• <b><strong>Bold</strong></b> and

<i><em>italic</em></i> text.• </body>• </html>

Page 8: HTML Hyper Text Markup Language It is used for describing web documents or web pages. A markup language is set of markup tags. HTML documents are described.

Some Simple Tags Example

Page 9: HTML Hyper Text Markup Language It is used for describing web documents or web pages. A markup language is set of markup tags. HTML documents are described.

Tags Attributes

• Tags can have attributes– Attributes specify properties and behavior– Few attributes can apply to every element:• id, style, class, title• The id is unique in the document• Content of title attribute is displayed as hint when the

element is hovered with the mouse.

Page 10: HTML Hyper Text Markup Language It is used for describing web documents or web pages. A markup language is set of markup tags. HTML documents are described.

Headings and Paragraphs

• Heading Tags (h1 – h6)<h1>Heading 1</h1><h2>Sub heading 2</h2><h3>Sub heading 3</h3>

• Paragraph Tags<p>This is my first paragraph</p><p>This is my second paragraph</p>

• Sections: div<div style="background: skyblue;">This is a div </div>

Page 11: HTML Hyper Text Markup Language It is used for describing web documents or web pages. A markup language is set of markup tags. HTML documents are described.

Headings and Paragraphs Example<!DOCTYPE HTML><html> <head><title>Headings and paragraphs</title></head> <body> <h1>Heading 1</h1> <h2>Sub heading 2</h2> <h3>Sub heading 3</h3>

<p>This is my first paragraph</p> <p>This is my second paragraph</p>

<div style="background:skyblue"> This is a div</div> </body></html>

Page 12: HTML Hyper Text Markup Language It is used for describing web documents or web pages. A markup language is set of markup tags. HTML documents are described.

Headings and Paragraphs Example

Page 13: HTML Hyper Text Markup Language It is used for describing web documents or web pages. A markup language is set of markup tags. HTML documents are described.

Ordered Lists: <ol> Tag

• Create an Ordered List using <ol></ol>:<ol type="1"> <li>Apple</li> <li>Orange</li> <li>Grapefruit</li></ol>

• Attribute values for type are 1, A, a, or i

Page 14: HTML Hyper Text Markup Language It is used for describing web documents or web pages. A markup language is set of markup tags. HTML documents are described.

Unordered Lists: <ul> Tag

• Create an Unordered List using <ul></ul>:<ul type="disk"> <li>Apple</li> <li>Orange</li> <li>Grapefruit</li></ul>

• Attribute values for type are:- disc, circle or square

Page 15: HTML Hyper Text Markup Language It is used for describing web documents or web pages. A markup language is set of markup tags. HTML documents are described.

HTML Tables

• Tables represent tabular data– A table consists of one or several rows

– Each row has one or more columns• Tables comprised of several core tags:

<table></table>: begin / end the table<tr></tr>: create a table row<td></td>: create tabular data (cell)

Page 16: HTML Hyper Text Markup Language It is used for describing web documents or web pages. A markup language is set of markup tags. HTML documents are described.

HTML Tables

• Start and end of a table

- <table> …… </table>

• Start and end of a row

- <tr> ……. </tr>

• Start and end of a cell in a row- <td> …….. </td>

Page 17: HTML Hyper Text Markup Language It is used for describing web documents or web pages. A markup language is set of markup tags. HTML documents are described.

Simple HTML Table Example• <html><head><title>Simple Table </title></head>• <body>• <table cellspacing="0" cellpadding="5">• <tr>• <td>Web Technology</td>• <td><a href="lecture1.ppt">Lecture 1</a></td>• </tr>• <tr>• <td>Web Technology</td>• <td><a href="lecture2.ppt">Lecture 2</a></td>• </tr>• <tr>• <td>Web Technology</td>• <td><a href="lecture2-demos.zip">• Lecture 2 - Demos</a></td>• </tr>• </table></body></html>

Page 18: HTML Hyper Text Markup Language It is used for describing web documents or web pages. A markup language is set of markup tags. HTML documents are described.

Simple HTML Table Example

Page 19: HTML Hyper Text Markup Language It is used for describing web documents or web pages. A markup language is set of markup tags. HTML documents are described.

Complete HTML Tables

• Table rows split into three semantic sections: header, body and footer– <thead> denotes table header and contains <th>

elements, instead of <td> elements– <tbody> denotes collection of table rows that

contains the data– <tfoot> denotes table footer but comes BEFORE

the <tbody> tag

Page 20: HTML Hyper Text Markup Language It is used for describing web documents or web pages. A markup language is set of markup tags. HTML documents are described.

Complete HTML Table Example• <table>• <thead>• <tr><th>Column 1</th><th>Column 2</th></tr>• </thead>• <tfoot>• <tr><td>Footer 1</td><td>Footer 2</td></tr>• </tfoot>• <tbody>• <tr><td>Cell 1.1</td><td>Cell 1.2</td></tr>• <tr><td>Cell 2.1</td><td>Cell 2.2</td></tr>• </tbody>• </table>

Page 21: HTML Hyper Text Markup Language It is used for describing web documents or web pages. A markup language is set of markup tags. HTML documents are described.

Complete HTML Table Example

Page 22: HTML Hyper Text Markup Language It is used for describing web documents or web pages. A markup language is set of markup tags. HTML documents are described.

Cell Spacing and Padding

• Tables have two important attributes:• Cellspacing cellpadding

cell cell

cell cell

cell

cell

cell

cell

Page 23: HTML Hyper Text Markup Language It is used for describing web documents or web pages. A markup language is set of markup tags. HTML documents are described.

Cell Spacing and Padding

• cellspacing- Defines the empty space between cells• cellpadding- Defines the empty space around the cell

content

Page 24: HTML Hyper Text Markup Language It is used for describing web documents or web pages. A markup language is set of markup tags. HTML documents are described.

Column and Row Span

• Table cells have two important attributes:• colspan- Defines how many columns the cell occupies• Rowspan- Defines how many rows the cell occupies

Page 25: HTML Hyper Text Markup Language It is used for describing web documents or web pages. A markup language is set of markup tags. HTML documents are described.

Column and Row Span Example<table border="1"><tr> <td>Cell[1,1]</td> <td colspan="2“ align="center"> Cell[2,1] </td></tr> <tr> <td>Cell[1,2]</td> <td rowspan="2">Cell[2,2]</td> <td>Cell[3,2]</td></tr><tr> <td>Cell[1,3]</td> <td>Cell[2,3]</td></tr></table>

Page 26: HTML Hyper Text Markup Language It is used for describing web documents or web pages. A markup language is set of markup tags. HTML documents are described.

Column and Row Span Example

Page 27: HTML Hyper Text Markup Language It is used for describing web documents or web pages. A markup language is set of markup tags. HTML documents are described.

HTML Forms

• Forms are the primary method for gathering data from site visitors

• Create a form block with- <form> … </form>• Example:• <form name="myForm" method="post" action="path/to/some-script.php">

• ...• </form>

Page 28: HTML Hyper Text Markup Language It is used for describing web documents or web pages. A markup language is set of markup tags. HTML documents are described.

HTML Forms

• The “method" attribute tells how the form data should be sent – via GET or POST request

• The "action" attribute tells where the form data should be sent

Page 29: HTML Hyper Text Markup Language It is used for describing web documents or web pages. A markup language is set of markup tags. HTML documents are described.

Form Fields

• Single-line text input fields:- <input type="text" name="FirstName" value="This is a text field" />

• Multi-line textarea fields:- <textarea name="Comments">This is a multi-line text field</textarea>

• Hidden fields contain data not shown to the user:- <input type="hidden" name="Account" value="This is a hidden text field" />

Page 30: HTML Hyper Text Markup Language It is used for describing web documents or web pages. A markup language is set of markup tags. HTML documents are described.

Form Fields

• Checkboxes:- <input type="checkbox" name="fruit" value="apple" />

• Radio buttons:- <input type="radio" name="title" value="Mr." />

• Radio buttons can be grouped, allowing only one to be selected from a group:

- <input type="radio" name="city" value=“Ghaziabad" />

- <input type="radio" name="city" value=“Faridabad" />

Page 31: HTML Hyper Text Markup Language It is used for describing web documents or web pages. A markup language is set of markup tags. HTML documents are described.

Form Fields

• Dropdown menus: <select name="gender"> <option value="Value 1”>Male</option> <option value="Value 2">Female</option>

<option value="Value 3">Other</option></select>• Submit button:- <input type="submit" name="submitBtn" value="Apply Now" />

Page 32: HTML Hyper Text Markup Language It is used for describing web documents or web pages. A markup language is set of markup tags. HTML documents are described.

Form Fields

• Reset button – brings the form to its initial state- <input type="reset" name="resetBtn" value="Reset the form" />

• Image button – acts like submit but image is displayed and click coordinates are sent

- <input type="image" src="submit.gif" name="submitBtn" alt="Submit" />

Page 33: HTML Hyper Text Markup Language It is used for describing web documents or web pages. A markup language is set of markup tags. HTML documents are described.

Form Fields

• Password input – a text field which masks the entered text with * signs

- <input type="password" name="pass" />• Multiple select field – displays the list of items in multiple lines,

instead of one- <select name="products" multiple="multiple"> <option value="Value 1" selected="selected">keyboard</option> <option value="Value 2">mouse</option> <option value="Value 3">speakers</option> </select>

Page 34: HTML Hyper Text Markup Language It is used for describing web documents or web pages. A markup language is set of markup tags. HTML documents are described.

HTML Frames

Page 35: HTML Hyper Text Markup Language It is used for describing web documents or web pages. A markup language is set of markup tags. HTML documents are described.

HTML Frames

• Frames provide a way to show multiple HTML documents in a single Web page

• The page can be split into separate views (frames) horizontally and vertically

• Frames were popular in the early ages of HTML development, but now their usage is rejected

• Frames are not supported by all user agents (browsers, search engines, etc.)

Page 36: HTML Hyper Text Markup Language It is used for describing web documents or web pages. A markup language is set of markup tags. HTML documents are described.

HTML Frames Example

• <html>• <head><title>Frames Example</title></head>

• <frameset cols="180px,*,150px">• <frame src="left.html" />• <frame src="middle.html" />• <frame src="right.html" />• </frameset>• </html>

Page 37: HTML Hyper Text Markup Language It is used for describing web documents or web pages. A markup language is set of markup tags. HTML documents are described.

HTML Frames Example

• <html>• <head><title>Frames Example</title></head>

• <frameset rows=“25%,*,25%">• <frame src=“Top.html" />• <frame src=“Main.html" />• <frame src=“Bottom.html" />• </frameset>• </html>

Page 38: HTML Hyper Text Markup Language It is used for describing web documents or web pages. A markup language is set of markup tags. HTML documents are described.

HTML Special Characters

• £• &pound;• British Pound• €• &#8364;• Euro• "• &quot;• Quotation Mark

• ¥• &yen;• Japanese Yen

• —• &mdash;• Em Dash• &nbsp;• Non-breaking Space

• &• &amp;• Ampersand• >• &gt;• Greater Than• <• &lt;• Less Than• ™• &trade;• Trademark Sign• ®• &reg;• Registered Trademark Sign• ©• &copy;• Copyright Sign

• Symbol• HTML Entity• Symbol Name


Recommended