learning html prepared by: m.rama bhadra rao assoc. professor, mca department
DESCRIPTION
Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department NOVA COLLEGE OF ENGINEERING AND TECHNOLOGY Web : www.mramabhadrarao.wordpress.com. 1. WHAT IS HTML?. HTML is a language for describing web pages. HTML stands for Hyper Text Markup Language - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/1.jpg)
1
Learning html
Prepared By: M.Rama Bhadra RaoAssoc. Professor, MCA Department
NOVA COLLEGE OF ENGINEERING AND TECHNOLOGYWeb: www.mramabhadrarao.wordpress.com
![Page 2: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/2.jpg)
2
HTML is a language for describing web pages.
HTML stands for Hyper Text Markup Language
HTML is not a programming language, it is a markup language
A markup language is a set of markup tags
The markup tags describe how text should be displayed
WHAT IS HTML?
![Page 3: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/3.jpg)
3
HTML markup tags are usually called HTML tags
HTML tags are keywords surrounded by angle brackets like <html>
HTML tags normally come in pairs like <b> and </b> The first tag in a pair is the start tag, the second tag is the end tag Note: The start and end tags are also called the opening and closing tags.
HTML MARKUP TAGS
![Page 4: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/4.jpg)
4
-An HTML file is a text file with HTML tags
-An HTML file name must end with .htm or .html
-An HTML file can be created using a simple text editor
-An HTML file is often called an HTML document or a Web Page
WHAT IS AN HTML FILE
![Page 5: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/5.jpg)
5
When you save an HTML file, you can use either the .htm or the .html extension. We use .htm in our examples. It is a habit from the past when commonly used software allowed only three letters in file extensions.With newer software it is perfectly safe to use .html.
HTM or HTML EXTENSION
![Page 6: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/6.jpg)
6
BASIC HTML TAGS
![Page 7: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/7.jpg)
7
<html><body>The content of the body element is displayed in your browser.</body></html>
EXAMPLE
![Page 8: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/8.jpg)
8
The content of the body element is displayed in your browser.
OUTPUT
![Page 9: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/9.jpg)
9
<html><body><p>This is a paragraph.</p><p>This is a paragraph.</p><p>This is a paragraph.</p><p>Paragraph elements are defined by the p tag.</p> </body></html>
HTML PARAGRAPHS
![Page 10: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/10.jpg)
10
This is a paragraph.This is a paragraph.This is a paragraph.Paragraph elements are defined by the p tag.
OUTPUT
![Page 11: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/11.jpg)
11
Headings are defined with the <h1> to <h6> tags. <h1> defines the largest heading. <h6> defines the smallest heading.
<h1>This is a heading </h1> <h2>This is a heading </h2> <h3>This is a heading </h3>
HTML HEADINGS
![Page 12: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/12.jpg)
12
Result:
This is a headingThis is a headingThis is a heading
HTML automatically displays an empty line before and after headings.
![Page 13: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/13.jpg)
13
EXAMPLE
<html><body><h1>This is heading 1</h1><h2>This is heading 2</h2><h3>This is heading 3</h3><h4>This is heading 4</h4><h5>This is heading 5</h5><h6>This is heading 6</h6>
<p>Use heading tags only for headings.Don't use them to make something <b>BIG or BOLD</b>.Use other tags for that.</p></body></html>
![Page 14: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/14.jpg)
14
This is heading 1This is heading 2This is heading 3This is heading 4This is heading 5This is heading 6Use heading tags only for headings. Don't use them to make something BIG or BOLD. Use other tags for that.
OUTPUT
![Page 15: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/15.jpg)
15
HTML PARAGRAPHS
Paragraphs are defined with the <p> tag.
<p>This is a paragraph</p> <p>This is another paragraph</p>
HTML automatically displays an empty line before and after a paragraph.
![Page 16: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/16.jpg)
16
EXAMPLE
<html><body>
<p>This is a paragraph.</p><p>This is a paragraph.</p><p>This is a paragraph.</p>
<p>Paragraph elements are defined by the p tag.</p>
</body></html>
![Page 17: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/17.jpg)
17
OUTPUT
This is a paragraph.
This is a paragraph.
This is a paragraph.
Paragraph elements are defined by the p tag.
![Page 18: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/18.jpg)
18
Use the <br> tag if you want a line break (a new line) without starting a new paragraph:
<p>This is<br>a para<br>graph with line breaks</p>
The <br> tag is an empty tag. It has no end tag like </br>.
HTML LINE BREAKS
![Page 19: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/19.jpg)
19
Comments can be inserted in the HTML code to make it more readable and understandable. Comments are ignored by the browser and not displayed.
Comments are written like this:
<!-- This is a comment -->
Note: There is an exclamation point after the opening bracket, but not before the closing bracket.
HTML COMMENTS
![Page 20: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/20.jpg)
20
<html><body>
<!--This comment will not be displayed--><p>This is a regular paragraph</p>
</body></html>
EXAMPLE
![Page 21: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/21.jpg)
21
This is a regular paragraph
OUTPUT
![Page 22: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/22.jpg)
22
<html><body>
<p>
My Bonnie lies over the ocean. My Bonnie lies over the sea. My Bonnie lies over the ocean. Oh, bring back my Bonnie to me.</p>
<p>Note that your browser ignores your layout!</p>
</body></html>
EXAMPLE
![Page 23: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/23.jpg)
23
My Bonnie lies over the ocean. My Bonnie lies over the sea. My Bonnie lies over the ocean. Oh, bring back my Bonnie to me.
Note that your browser ignores your layout!
OUTPUT
![Page 24: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/24.jpg)
24
Have you ever seen a Web page and wondered "Hey! How did they do that?“
To find out, click the VIEW option in your browser's toolbar and select SOURCE or PAGE SOURCE. This will open a window that shows you the HTML code of the page.
HOW TO VIEW HTML SOURCE
![Page 25: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/25.jpg)
25
This example demonstrates how to insert a horizontal rule.<html><body><p>The hr tag defines a horizontal rule:</p><hr><p>This is a paragraph</p><hr><p>This is a paragraph</p><hr><p>This is a paragraph</p></body></html>
HORIZONTAL RULE
![Page 26: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/26.jpg)
26
The hr tag defines a horizontal rule:
This is a paragraph
This is a paragraph
This is a paragraph
OUTPUT
![Page 27: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/27.jpg)
27
Tag Description<html> Defines an HTML document
<body> Defines the document's body
<h1> to <h6> Defines header 1 to header 6
<p> Defines a paragraph
<br> Inserts a single line break
<hr> Defines a horizontal rule <!--> Defines a comment
Revision
![Page 28: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/28.jpg)
28
HTML ELEMENT
An HTML Element
Start Element ContentEnd
<p> This is a paragraph
</p>
![Page 29: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/29.jpg)
29
WHY LOWERCASE TAGS?
HTML tags are not case sensitive:
<P> means the same as <p>.
Plenty of web sites use uppercase HTML tags in their pages.
Recommends lowercase in HTML 4, and demands lowercase tags in newer versions of (X)HTML.
![Page 30: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/30.jpg)
30
Attributes provide additional information about HTML elements.
HTML ATTRIBUTES
![Page 31: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/31.jpg)
31
HTML tags can have attributes. Attributes provide additional information about the HTML element.
Attributes always come in name/value pairs like this: name="value“.
Attributes are always specified in the start tag of an HTML element.
HTML ATTRIBUTES
![Page 32: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/32.jpg)
32
<body> defines the body of an HTML document.
<body bgcolor="yellow"> has additional information about the background color.
ATTRIBUTES EXAMPLE-1
![Page 33: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/33.jpg)
33
<html><body>
<h1 align="center">This is heading 1</h1>
<p>The heading above is aligned to the center of this page. The heading above is aligned to the center of this page. The heading above is aligned to the center of this page.</p>
</body></html>
CENTER ALIGNED HEADING
![Page 34: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/34.jpg)
34
OUTPUT
This is heading 1
The heading above is aligned to the center of this page. The heading above is aligned to the center of this page. The heading above is aligned to the center of this page.
![Page 35: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/35.jpg)
35
ATTRIBUTES EXAMPLE- 2
<body> defines the body of an HTML document.
<body bgcolor="yellow"> has additional information about the background color.
![Page 36: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/36.jpg)
36
EXAMPLE: BACKGROUND COLOR
<html><body bgcolor="yellow"><h2>Look: Colored Background!</h2></body></html>
![Page 37: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/37.jpg)
37
OUTPUT
LOOK: COLORED BACKGROUND!
![Page 38: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/38.jpg)
38
<table> defines an HTML table.
<table border="1"> has additional information about the border around the table.
ATTRIBUTES EXAMPLE- 3
![Page 39: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/39.jpg)
39
This text is bold
This text is big
This text is italic
This is computer output
This is and superscript subscript
HTML TEXT FORMATTING
![Page 40: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/40.jpg)
40
<html><body>
<p><b>This text is bold</b></p><p><big>This text is big</big></p><p><i>This text is italic</i></p><p><code>This is computer output</code></p><p>This is<sub> subscript</sub> and <sup>superscript</sup></p>
</body></html>
EXAMPLE
![Page 41: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/41.jpg)
41
HTML uses tags like <b> and <i> for formatting output, like bold or italic text.
These HTML tags are called formatting tags.
HTML FORMATTING TAGS
![Page 42: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/42.jpg)
42
<html><body>
<p><b>This text is bold</b></p><p><strong>This text is strong</strong></p><p><big>This text is big</big></p><p><em>This text is emphasized</em></p><p><i>This text is italic</i></p><p><small>This text is small</small></p><p>This is<sub> subscript</sub> and <sup>superscript</sup></p>
</body></html>
EXAMPLE - TEXT FORMATTING
![Page 43: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/43.jpg)
43
OUTPUT
This text is bold
This text is strong
This text is big
This text is emphasized
This text is italic
This text is small
This is and superscript subscript
![Page 44: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/44.jpg)
44
EXAMPLE – PREFORMATTED TEXT<html><body>
<pre>This ispreformatted text.It preserves both spacesand line breaks.</pre>
<p>The pre tag is good for displaying computer code:</p>
<pre>for i = 1 to 10 print inext i</pre>
</body></html>
![Page 45: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/45.jpg)
45
OUTPUT
This is preformatted text. It preserves both spaces and line breaks.
The pre tag is good for displaying computer code:
for i = 1 to 10 print i
next i
![Page 46: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/46.jpg)
46
<html><body>
<address>Donald Duck<br>BOX 555<br>Disneyland<br>USA</address>
</body></html>
ADDRESS
![Page 47: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/47.jpg)
47
OUTPUT
Donald DuckBOX 555DisneylandUSA
![Page 48: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/48.jpg)
48
<html><body>
<abbr title="United Nations">UN</abbr><br><acronym title="World Wide Web">WWW</acronym>
<p>The title attribute is used to show the spelled-out version when holding the mouse pointer over the acronym or abbreviation.</p>
<p>This only works for the acronym element in IE 5.</p>
<p>This works for both the abbr and acronym element in Netscape 6.2.</p>
</body></html>
ABBREVIATIONS AND ACRONYMS
![Page 49: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/49.jpg)
49
UN WWW
The title attribute is used to show the spelled-out version when holding the mouse pointer over the acronym or abbreviation.
This only works for the acronym element in IE 5.
This works for both the abbr and acronym element in Netscape 6.2.
OUTPUT
![Page 50: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/50.jpg)
50
<html><body>
Here comes a long quotation:<blockquote>This is a long quotation. This is a long quotation. This is a long quotation. This is a long quotation. This is a long quotation.</blockquote>
Here comes a short quotation:<q>This is a short quotation</q>
<p>With the block quote element, the browser inserts line breaks and margins, but the q element does not render as anything special.</p>
</body></html>
EXAMPLE – QUOTATIONS
![Page 51: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/51.jpg)
51
Here comes a long quotation:
This is a long quotation. This is a long quotation. This is a long quotation. This is a long quotation. This is a long quotation.
Here comes a short quotation: This is a short quotation
With the block quote element, the browser inserts line breaks and margins, but the q element does not render as anything special.
OUTPUT
![Page 52: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/52.jpg)
52
<html><body>
<p>a dozen is <del>twenty</del> <ins>twelve</ins> pieces</p>
<p>Most browsers will overstrike deleted text and underline inserted text.</p>
<p>Some older browsers will display deleted or inserted text as plain text.</p>
</body></html>
DELETED AND INSERTED TEXT
![Page 53: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/53.jpg)
53
a dozen is twenty twelve pieces
Most browsers will overstrike deleted text and underline inserted text.
Some older browsers will display deleted or inserted text as plain text.
OUTPUT
![Page 54: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/54.jpg)
54
Revision
Tag Description<b> Defines bold text
<big> Defines big text
<em> Defines emphasized text
<i> Defines italic text
<small> Defines small text
<strong> Defines strong text
![Page 55: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/55.jpg)
55
Tag Description<sub> Defines subscripted text<sup> Defines superscripted text<ins> Defines inserted text
<del> Defines deleted text
<s> Deprecated. Use <del> instead
<strike> Deprecated. Use <del> instead
<u> Deprecated. Use styles instead
![Page 56: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/56.jpg)
56
NON-BREAKING SPACE
The most common character entity in HTML is the non-breaking space.
Normally HTML will truncate spaces in your text. If you write 10 spaces in your text HTML will remove 9 of them.
To add lots of spaces to your text, use the character entity.
![Page 57: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/57.jpg)
57
COMMONLY USED CHARACTER
Result Description Entity Name Entity Number
non-breaking space
 
< less than < <
> greater than > >
& ampersand & &
¢ cent ¢ ¢
![Page 58: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/58.jpg)
58
Result Description Entity Name Entity Number
£ pound £ £
¥ yen ¥ ¥
€ euro € €
§ section § §
© copyright © ©
® registered trademark
® ®
![Page 59: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/59.jpg)
59
HTML uses a hyperlink to link to another document on the Web.
HTML LINKS
![Page 60: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/60.jpg)
60
EXAMPLES
Create hyperlinks
This example demonstrates how to create links in an HTML document.
An image as a link
This example demonstrates how to use an image as a link.
![Page 61: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/61.jpg)
61
EXAMPLE - CREATE HYPERLINKS
<html><body>
<p><a href="lastpage.htm">This text</a> is a link to a page on this Web site.</p>
<p><a href="http://www.microsoft.com/">This text</a> is a link to a page on the World Wide Web.</p>
</body></html>
![Page 62: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/62.jpg)
62
OUTPUT
This text is a link to a page on this Web site.
This text is a link to a page on the World Wide Web.
![Page 63: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/63.jpg)
63
<html><body><p>You can also use an image as a link:<a href="lastpage.htm"><img border="0" src="buttonnext.gif" width="65" height="38"></a></p>
</body></html>
AN IMAGE AS A LINK
![Page 64: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/64.jpg)
64
OUTPUT
You can also use an image as a link:
![Page 65: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/65.jpg)
65
THE ANCHOR TAG AND THE href ATTRIBUTE
HTML uses the <a> (anchor) tag to createa link to another document.
An anchor can point to any resource on theWeb: an HTML page, an image, a soundfile, a movie, etc.
The syntax of creating an anchor:
![Page 66: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/66.jpg)
66
<a href="url">Text to be displayed</a>
The <a> tag is used to create an anchor tolink from, the href attribute is used to address the document to link to, and the words between the open and close of the anchor tag will be displayed as a hyperlink.
THE ANCHOR TAG AND THE Href ATTRIBUTE
![Page 67: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/67.jpg)
67
THE TARGET ATTRIBUTE
With the target attribute, you can definewhere the linked document will be opened.The line below will open the document in anew browser window:
<a href= “www.nova.ac.in”target="_blank">Visit NovaCollege.</a>
![Page 68: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/68.jpg)
68
The Anchor Tag and the Name Attribute
The name attribute is used to create a named anchor. When using named anchors we can create links that can jump directly into a specific section on a page, instead of letting the user scroll around to find what he/she is looking for.
Below is the syntax of a named anchor:
<a name="label">Text to be displayed</a>
![Page 69: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/69.jpg)
69
OPEN A LINK IN A NEW BROWSER WINDOW
<html><body>
<a href="lastpage.htm" target="_blank">Last Page</a>
<p>If you set the target attribute of a link to "_blank",the link will open in a new window.</p>
</body></html>
![Page 70: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/70.jpg)
70
OUTPUT
Last Page
If you set the target attribute of a link to "_blank", the link will open in a new window.
![Page 71: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/71.jpg)
71
LINK TO A LOCATION ON THE SAME PAGE
<html><body>
<p><a href="#C4">See also Chapter 4.</a></p>
<h2>Chapter 1</h2><p>This chapter explains ba bla bla</p>
<h2>Chapter 2</h2><p>This chapter explains ba bla bla</p>
<h2>Chapter 3</h2><p>This chapter explains ba bla bla</p>
</body></html>
![Page 72: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/72.jpg)
72
OUTPUT
See also Chapter 4.
Chapter 1This chapter explains ba bla bla
Chapter 2This chapter explains ba bla bla
Chapter 3This chapter explains ba bla bla
![Page 73: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/73.jpg)
73
CREATE A MAILTO LINK
<html>
<body>
<p>This is a mail link:<a href="mailto:[email protected]?subject=Hello%20again">Send Mail</a></p>
<p><b>Note:</b> Spaces between words should be replaced by %20 to<b>ensure</b> that the browser will display your text properly.</p>
</body></html>
![Page 74: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/74.jpg)
74
OUTPUT
This is a mail link: Send Mail
Note: Spaces between words should bereplaced by %20 to ensure that the browser will display your text properly.
![Page 75: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/75.jpg)
75
HTML FRAMES
With frames, you can display more than oneWeb page in the same browser window.
![Page 76: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/76.jpg)
76
VERTICAL FRAMESET
<html>
<frameset cols="25%,50%,25%">
<frame src="frame_a.htm"> <frame src="frame_b.htm"> <frame src="frame_c.htm">
</frameset>
</html>
![Page 77: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/77.jpg)
77
OUTPUT
![Page 78: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/78.jpg)
78
HORIZONTAL FRAMESET
<html>
<frameset rows="25%,50%,25%">
<frame src="frame_a.htm"><frame src="frame_b.htm">‘
<frame src="frame_c.htm">
</frameset>
</html>
![Page 79: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/79.jpg)
79
OUTPUT
![Page 80: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/80.jpg)
80
FRAMES
With frames, you can display more than one HTML document in the same browser window. Each HTML document is called a frame, and each frame is independent of the others.
The disadvantages of using frames are:The web developer must keep track of more HTML documents It is difficult to print the entire page
![Page 81: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/81.jpg)
81
THE FRAMESET TAG
The <frameset> tag defines how to divide the window into frames.
Each frameset defines a set of rows or Columns.
The values of the rows/columns indicate the amount of screen area each row/column will occupy.
![Page 82: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/82.jpg)
82
THE FRAME TAG
The <frame> tag defines what HTML document to put into each frame.
In the example below we have a frameset with two columns.
The first column is set to 25% of the width of the browser window. The second column is set to 75% of the width of the browser window. The HTML document "frame_a.htm" is put into the first column, and the HTML document "frame_b.htm" is put into the second column:
![Page 83: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/83.jpg)
83
THE FRAME TAG
<frameset cols="25%,75%"> <frame src="frame_a.htm">
<frame src="frame_b.htm"> </frameset>
Note: The frameset column size value can also beset in pixels (cols="200,500"), and one of the columns can be set to use the remaining space (cols="25%,*").
![Page 84: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/84.jpg)
84
BASIC NOTES - USEFUL TIPSIf a frame has visible borders, the user can resize it by dragging the border. To prevent a user from doing this, you can add noresize="noresize" to the <frame> tag.
Add the <noframes> tag for browsers that do notsupport frames.
Important: You cannot use the <body></body> tagstogether with the <frameset></frameset> tags! However, ifyou add a <noframes> tag containing some text for browsersthat do not support frames, you will have to enclose the textin <body></body> tags! See how it is done in the firstexample below.
![Page 85: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/85.jpg)
85
HOW TO USE THE <NOFRAMES> TAG
<html>
<frameset cols="25%,50%,25%"><frame src="frame_a.htm"><frame src="frame_b.htm"><frame src="frame_c.htm">
<noframes><body>Your browser does not handle frames!</body></noframes>
</frameset>
</html>
![Page 86: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/86.jpg)
86
OUTPUT
![Page 87: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/87.jpg)
87
MIXED FRAMESET
<html>
<frameset rows="50%,50%">
<frame src="frame_a.htm">
<frameset cols="25%,75%"><frame src="frame_b.htm"><frame src="frame_c.htm"></frameset>
</frameset>
</html>
![Page 88: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/88.jpg)
88
OUTPUT
![Page 89: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/89.jpg)
89
FRAMESET WITH NORESIZE=“NORESIZE’
<html>
<frameset rows="50%,50%">
<frame noresize="noresize" src="frame_a.htm">
<frameset cols="25%,75%"><frame noresize="noresize" src="frame_b.htm"><frame noresize="noresize" src="frame_c.htm"></frameset>
</frameset>
</html>
![Page 90: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/90.jpg)
90
OUTPUT
![Page 91: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/91.jpg)
91
NAVIGATION FRAME
<html>
<frameset cols="120,*">
<frame src="tryhtml_contents.htm"><frame src="frame_a.htm" name="showframe">
</frameset>
</html>
![Page 92: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/92.jpg)
92
OUTPUT
![Page 93: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/93.jpg)
93
JUMP TO A SPECIFIED SECTION WITHIN A FRAME
<html>
<frameset cols="20%,80%">
<frame src="frame_a.htm"><frame src="link.htm#C10">
</frameset>
</html>
![Page 94: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/94.jpg)
94
OUTPUT
![Page 95: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/95.jpg)
95
JUMP TO A SPECIFIED SECTION WITH FRAME NAVIGATION
<html>
<frameset cols="180,*">
<frame src="content.htm"><frame src="link.htm" name="showframe">
</frameset>
</html>
![Page 96: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/96.jpg)
96
OUTPUT
![Page 97: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/97.jpg)
97
FRAME TAGS
Tag Description<frameset> Defines a set of frames
<frame>) Defines a sub window (a frame
<noframes> Defines a noframe section for browsers that
do not handle frames
![Page 98: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/98.jpg)
98
HTML TABLES
With HTML you can create tables.
Examples
Tables
This example demonstrates how to create tables in an HTML document.
Table borders
This example demonstrates different table borders. (You can find moreexamples at the bottom of this page)
![Page 99: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/99.jpg)
99
EXAMPLE: TABLES<html><body>
<p>Each table starts with a table tag. Each table row starts with a tr tag.Each table data starts with a td tag.</p>
<h4>One column:</h4><table border="1"><tr> <td>100</td></tr></table>
<h4>One row and three columns:</h4><table border="1"><tr> <td>100</td> <td>200</td>
![Page 100: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/100.jpg)
100
EXAMPLE:TABLES<td>300</td></tr></table>
<h4>Two rows and three columns:</h4><table border="1"><tr> <td>100</td> <td>200</td> <td>300</td></tr><tr> <td>400</td> <td>500</td> <td>600</td></tr></table>
</body></html>
![Page 101: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/101.jpg)
101
OUTPUT
![Page 102: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/102.jpg)
102
TABLE BORDERS
<html><body>
<h4>With a normal border:</h4> <table border="1"><tr> <td>First</td> <td>Row</td></tr> <tr><td>Second</td> <td>Row</td></tr></table>
<h4>With a thick border:</h4> <table border="8">
![Page 103: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/103.jpg)
103
TABLE BORDERS
<tr> <td>First</td> <td>Row</td></tr> <tr> <td>Second</td><td>Row</td></tr></table>
<h4>With a very thick border:</h4> <table border="15"><tr><td>First</td> <td>Row</td></tr> <tr> <td>Second</td> <td>Row</td></tr></table>
</body></html>
![Page 104: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/104.jpg)
104
OUTPUT
![Page 105: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/105.jpg)
105
TABLES
Tables are defined with the <table> tag. A table is divided into rows (with the <tr> tag), and each row is divided into data cells (with the <td> tag). The letters td stands for "table data," which is the content of a data cell. A data cell can contain text, images, lists, paragraphs, forms, horizontal rules, tables, etc.
![Page 106: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/106.jpg)
106
TABLES
<table border="1"> <tr> <td>row 1, cell 1</td> <td>row 1, cell 2</td> </tr> <tr> <td>row 2, cell 1</td> <td>row 2, cell 2</td> </tr> </table>
![Page 107: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/107.jpg)
107
TABLES
How it looks in a browser:
![Page 108: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/108.jpg)
108
TABLES AND THE BORDER ATTRIBUTE
If you do not specify a border attribute the table will be displayed without any borders. Sometimes this can be useful, but most of the time, you want the borders to show. To display a table with borders, you will have to use the border attribute:
<table border="1"> <tr> <td>Row 1, cell 1</td> <td>Row 1, cell 2</td> </tr> </table>
![Page 109: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/109.jpg)
109
HEADINGS IN A TABLEHeadings in a table are defined with the
<th> tag.<table border="1"> <tr> <th>Heading</th> <th>Another Heading </th> </tr> <tr> <td>row 1, cell 1</td> <td>row 1, cell 2 </td> </tr> <tr> <td>row 2, cell 1</td> <td>row 2, cell 2</td> </tr> </table>
![Page 110: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/110.jpg)
110
HEADINGS IN A TABLE
How it looks in a browser:
![Page 111: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/111.jpg)
111
TABLE WITH NO BORDER
This example demonstrates a table with no borders.
<html><body>
<h4>This table has no borders:</h4><table><tr> <td>100</td> <td>200</td> <td>300</td></tr><tr> <td>400</td> <td>500</td> <td>600</td></tr></table>
![Page 112: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/112.jpg)
112
TABLE WITH NO BORDER
<h4>And this table has no borders:</h4><table border="0"><tr> <td>100</td> <td>200</td> <td>300</td></tr><tr><td>400</td> <td>500</td><td>600</td></tr></table>
</body></html>
![Page 113: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/113.jpg)
113
OUTPUT
![Page 114: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/114.jpg)
114
To do….
![Page 115: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/115.jpg)
115
TABLE WITH CAPTION
This example demonstrates a table with a caption.
<html><body>
<h4>This table has a caption,and a thick border:</h4>
<table border="6"><caption>My Caption</caption><tr> <td>100</td> <td>200</td><td>300</td></tr><tr> <td>400</td<td>500</td><td>600</td></tr></table>
</body></html>
![Page 116: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/116.jpg)
116
OUTPUT
![Page 117: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/117.jpg)
117
TABLE CELLS THAT SPAN MORE THAN ONE ROW/COLUMN
This example demonstrates how to define table cells that span more than one row or one column.
<html><body>
<h4>Cell that spans two columns:</h4><table border="1"><tr> <th>Name</th><th colspan="2">Telephone</th></tr><tr><td>Bill Gates</td> <td>555 77 854</td> <td>555 77 855</td></tr></table>• `
![Page 118: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/118.jpg)
118
TABLE CELLS THAT SPAN MORE THAN ONE ROW/COLUMN
<h4>Cell that spans two rows:</h4><table border="1">
<tr> <th>First Name:</th> <td>Bill Gates</td></tr><tr> <th rowspan="2">Telephone:</th> <td>555 77 854</td></tr><tr> <td>555 77 855</td></tr></table>
</body></html>
![Page 119: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/119.jpg)
119
OUTPUT
![Page 120: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/120.jpg)
120
CELL PADDING
This example demonstrates how to use cell padding to create more white space between the cell content and its borders.
<html><body>
<h4>Without cellpadding:</h4><table border="1"><tr> <td>First</td> <td>Row</td></tr> <tr> <td>Second</td> <td>Row</td></tr></table>
![Page 121: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/121.jpg)
121
EXAMPLE: CELL PADDING
<h4>With cellpadding:</h4><table border="1" cellpadding="10"><tr> <td>First</td> <td>Row</td></tr> <tr> <td>Second</td> <td>Row</td></tr></table>
</body></html>
![Page 122: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/122.jpg)
122
OUTPUT
![Page 123: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/123.jpg)
123
EXAMPLE: CELL SPACINGThis example demonstrates how to use cellspacing to increase the distance between the cells.
<html><body>
<h4>Without cellspacing:</h4><table border="1"><tr> <td>First</td> <td>Row</td></tr> <tr> <td>Second</td> <td>Row</td></tr></table>
![Page 124: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/124.jpg)
124
EXAMPLE: CELL SPACING
<h4>With cellspacing:</h4><table border="1" cellspacing="10"><tr> <td>First</td> <td>Row</td></tr> <tr> <td>Second</td> <td>Row</td></tr></table>
</body></html>
![Page 125: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/125.jpg)
125
OUTPUT
![Page 126: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/126.jpg)
126
ADD A BACKGROUND COLOR OR A BACKGROUND IMAGE TO A TABLE
This example demonstrates how to add a background to a table.
<html><body>
<h4>A background color:</h4><table border="1" bgcolor="red"><tr> <td>First</td> <td>Row</td></tr> <tr> <td>Second</td> <td>Row</td></tr></table>
![Page 127: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/127.jpg)
127
ADD A BACKGROUND COLOR OR A BACKGROUND IMAGE TO A TABLE
<h4>A background image:</h4><table border="1" background="bgdesert.jpg"><tr> <td>First</td> <td>Row</td></tr> <tr> <td>Second</td> <td>Row</td></tr></table>
</body></html>
![Page 128: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/128.jpg)
128
OUTPUT
![Page 129: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/129.jpg)
129
ADD A BACKGROUND COLOR OR A BACKGROUND IMAGE TO A TABLE CELL
This example demonstrates how to add a background to one or more table cells.
<html><body>
<h4>Cell backgrounds:</h4> <table border="1"><tr> <td bgcolor="red">First</td> <td>Row</td></tr> <tr> <td background="bgdesert.jpg"> Second</td> <td>Row</td></tr></table>
</body></html>
![Page 130: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/130.jpg)
130
OUTPUT
![Page 131: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/131.jpg)
131
ALIGN THE CONTENT IN A TABLE CELL
This example demonstrates how to use the "align" attribute to align thecontent of cells, to create a "nice-looking" table.
<html><body>
<table width="400" border="1"> <tr> <th align="left">Money spent on....</th> <th align="right">January</th> <th align="right">February</th> </tr> <tr> <td align="left">Clothes</td> <td align="right">$241.10</td> <td align="right">$50.20</td> </tr>
![Page 132: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/132.jpg)
132
ALIGN THE CONTENT IN A TABLE CELL
<tr> <td align="left">Make-Up</td> <td align="right">$30.00</td> <td align="right">$44.45</td> </tr> <tr> <td align="left">Food</td> <td align="right">$730.40</td> <td align="right">$650.00</td> </tr> <tr> <th align="left">Sum</th> <th align="right">$1001.50</th> <th align="right">$744.65</th> </tr></table>
</body></html>
![Page 133: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/133.jpg)
133
To Do..
![Page 134: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/134.jpg)
134
HTML LIST
HTML supports
An unordered listAn ordered listAn defination list
![Page 135: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/135.jpg)
135
AN UNORDERED LIST
<html><body>
<h4>An Unordered List:</h4><ul> <li>Coffee</li> <li>Tea</li> <li>Milk</li></ul>
</body></html>
![Page 136: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/136.jpg)
136
OUTPUT
An Unordered List:
• Coffee • Tea • Milk
![Page 137: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/137.jpg)
137
AN ORDERED LIST
<html><body>
<h4>An Ordered List:</h4><ol> <li>Coffee</li> <li>Tea</li> <li>Milk</li></ol>
</body></html>
![Page 138: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/138.jpg)
138
OUTPUT
An Ordered List:
1.Coffee 2.Tea 3. Milk
![Page 139: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/139.jpg)
139
DEFINITION LISTS
A definition list is not a list of items. This is a list of terms and explanation of the terms.A definition list starts with the <dl> tag. Each definition-list term starts with the <dt> tag. Each definition-list definition starts with the <dd> tag.
<dl> <dt>Coffee</dt><dd>Black hot drink</dd> <dt>Milk</dt> <dd>White cold drink</dd> </dl>
![Page 140: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/140.jpg)
140
DEFINITION LISTS
Here is how it looks in a browser:
CoffeeBlack hot drink
MilkWhite cold drink
![Page 141: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/141.jpg)
141
DIFFERENT TYPES OF ORDERED LISTS
This example demonstrates different types of ordered lists.
<html><body>
<h4>Numbered list:</h4><ol> <li>Apples</li> <li>Bananas</li> <li>Lemons</li> <li>Oranges</li></ol>
![Page 142: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/142.jpg)
142
OUTPUT
Numbered list:
1. Apples 2.Bananas 3.Lemons 4.Oranges
![Page 143: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/143.jpg)
143
DIFFERENT TYPES OF ORDERED LISTS
<h4>Letters list:</h4><ol type="A"> <li>Apples</li> <li>Bananas</li> <li>Lemons</li> <li>Oranges</li></ol>
![Page 144: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/144.jpg)
144
OUTPUT
Letters list:
A. Apples B. Bananas C. Lemons D. Oranges
![Page 145: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/145.jpg)
145
DIFFERENT TYPES OF ORDERED LISTS
<h4>Lowercase letters list:</h4><ol type="a"> <li>Apples</li> <li>Bananas</li> <li>Lemons</li> <li>Oranges</li></ol>
![Page 146: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/146.jpg)
146
OUTPUT
Lowercase letters list:
a. Apples b. Bananas c. Lemons c. Oranges
![Page 147: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/147.jpg)
147
DIFFERENT TYPES OF ORDERED LISTS
<h4>Roman numbers list:</h4><ol type="I"> <li>Apples</li> <li>Bananas</li> <li>Lemons</li> <li>Oranges</li></ol>
![Page 148: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/148.jpg)
148
OUTPUT
Roman numbers list:
I. Apples II. Bananas
III. Lemons IV. Oranges
![Page 149: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/149.jpg)
149
DIFFERENT TYPES OF ORDERED LISTS
<h4>Lowercase Roman numbers list:</h4><ol type="i"> <li>Apples</li> <li>Bananas</li> <li>Lemons</li> <li>Oranges</li></ol>
</body></html>
![Page 150: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/150.jpg)
150
OUTPUT
Lowercase Roman numbers list:
i. Apples ii. Bananas iii. Lemons iv. Oranges
![Page 151: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/151.jpg)
151
DIFFERENT TYPES OF UNORDERED LISTS
This example demonstrates different types of unordered lists.
![Page 152: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/152.jpg)
152
OUTPUT
![Page 153: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/153.jpg)
153
DIFFERENT TYPES OF UNORDERED LISTS
![Page 154: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/154.jpg)
154
OUTPUT
![Page 155: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/155.jpg)
155
DIFFERENT TYPES OF UNORDERED LISTS
![Page 156: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/156.jpg)
156
OUTPUT
![Page 157: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/157.jpg)
157
To do..
![Page 158: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/158.jpg)
158
To do…
![Page 159: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/159.jpg)
159
Revision
Tag Description
<ol> Defines an ordered list
<ul> Defines an unordered list
<li> Defines a list item
<dl> Defines a definition list
![Page 160: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/160.jpg)
160
LIST TAGS
Tag Description<dt> Defines a definition term
<dd> Defines a definition description
![Page 161: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/161.jpg)
161
HTML FORMS AND INPUT
HTML Forms are used to select different kinds of user input.
ExamplesText fieldsThis example demonstrates how to create text fields on an HTML page. A user can write text in a text field.
Password fieldsThis example demonstrates how to create a password field on an HTML page.
![Page 162: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/162.jpg)
162
EXAMPLE: TEXT FIELDS
![Page 163: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/163.jpg)
163
OUTPUT
![Page 164: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/164.jpg)
164
PASSWORD FIELDS
![Page 165: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/165.jpg)
165
OUTPUT
![Page 166: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/166.jpg)
166
FORMS
A form is an area that can contain form elements.
Form elements are elements that allow the user to enter information (like text fields, textarea fields, drop-down menus, radio buttons, checkboxes, etc.) in a form.
A form is defined with the <form> tag.
<form> <input> </input> </form>
![Page 167: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/167.jpg)
167
INPUT
The most used form tag is the <input> tag. The type of input is specified with the type attribute. The most commonly used input types are explained below.
![Page 168: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/168.jpg)
168
TEXT FIELDSText fields are used when you want the user to type letters, numbers, etc. in a form.
<form> First name: <input type="text" name="firstname"> <br> Last name: <input type="text" name="lastname"></form>
![Page 169: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/169.jpg)
169
TEXT FIELDS
How it looks in a browser:First name:
Last name:
Note that the form itself is not visible. Alsonote that in most browsers, the width of the text field is 20 characters by default.
![Page 170: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/170.jpg)
170
RADIO BUTTONS
Radio Buttons are used when you want the user to select one of a limited number of choices.
<form> <input type="radio" name="sex" value="male"> Male <br> <input type="radio" name="sex" value="female">Female </form>
![Page 171: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/171.jpg)
171
RADIO BUTTONS
How it looks in a browser:
Male Female
Note that only one option can be chosen.
![Page 172: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/172.jpg)
172
CHECKBOXESCheckboxes are used when you want the user to select one or more options of a limited number of choices.
<form> I have a bike: <input type="checkbox" name="vehicle" value="Bike"> <br> I have a car: <input type="checkbox" name="vehicle" value="Car"> <br> I have an airplane: <input type="checkbox" name="vehicle" value="Airplane"> </form>
![Page 173: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/173.jpg)
173
CHECKBOXES
![Page 174: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/174.jpg)
174
THE FORM’S ACTION ATTRIBUT AND THE SUBMIT BUTTON
When the user clicks on the "Submit" button, the content of the form is sent to the server. The form's action attribute defines the name of the file to send the content to. The file defined in the action attribute usually does something with the received input.
<form name="input" action="html_form_submit.asp" method="get"> Username: <input type="text" name="user"><input type="submit" value="Submit"></form>
![Page 175: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/175.jpg)
175
THE FORM’S ACTION ATTRIBUT AND THE SUBMIT BUTTON
How it looks in a browser:
Username:
If you type some characters in the text field above, and click the "Submit" button, the browser will send your input to a page called "html_form_submit.asp". The page will show you the received input.
![Page 176: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/176.jpg)
176
SIMPLE DROP DOWN BOX
This example demonstrates how to create a simple drop-down box on
an HTML page. A drop-down box is a selectable list.
![Page 177: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/177.jpg)
177
OUTPUT
![Page 178: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/178.jpg)
178
ANOTHER DROP DOWN BOX
This example demonstrates how to create a simple drop-down box with a pre-selected value.
![Page 179: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/179.jpg)
179
OUTPUT
![Page 180: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/180.jpg)
180
EXAMPLE: TEXTAREA
This example demonstrates how to create a text-area (a multi-line text input control). A user can write text in the text-area. In a text-area you can write an unlimited number of characters.
![Page 181: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/181.jpg)
181
OUTPUT
![Page 182: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/182.jpg)
182
CREAT A BUTTON
This example demonstrates how to create a button. On the
button you can define your own text.
![Page 183: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/183.jpg)
183
OUTPUT
![Page 184: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/184.jpg)
184
EXAMPLE: INSERT IMAGES
![Page 185: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/185.jpg)
185
OUTPUT
![Page 186: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/186.jpg)
186
THE ALT ATTRIBUTE
The alt attribute is used to define an "alternate text" for animage. The value of the alt attribute is an author-defined text:
<img src="boat.gif" alt="Big Boat">
The "alt" attribute tells the reader what he or she is missing on a page if the browser can't load images. The browser will then display the alternate text instead of the image. It is a good practice to include the "alt" attribute for each image on a page, to improve the display and usefulness of your document for people who have text-only browsers.
![Page 187: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/187.jpg)
187
BACKGROUND MAGE
This example demonstrates how to add a background image to an HTML page.
![Page 188: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/188.jpg)
188
OUTPUT
![Page 189: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/189.jpg)
189
ALIGNING IMAGES
This example demonstrates how to align an image within the text.
![Page 190: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/190.jpg)
190
OUTPUT
![Page 191: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/191.jpg)
191
ALIGNING IMAGES
![Page 192: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/192.jpg)
192
OUTPUT
![Page 193: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/193.jpg)
193
LET THE IMAGE FLOAT
This example demonstrates how to let an image float to the left or right of a paragraph.
![Page 194: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/194.jpg)
194
OUTPUT
![Page 195: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/195.jpg)
195
ADJUST IMAGE TO DIFFERENT SIZES
This example demonstrates how to adjust images to different sizes.
![Page 196: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/196.jpg)
196
OUTPUT
![Page 197: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/197.jpg)
197
MAKE A HYPERLINK OF AN IMAGE
This example demonstrates how to use an image as a link.
![Page 198: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/198.jpg)
198
OUTPUT
![Page 199: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/199.jpg)
199
HTML META
Document descriptionInformation inside a meta element describes the document.Document keywordsInformation inside a meta element describes the document's keywords.Redirect a userThis example demonstrates how to redirect a user if your site address has changed.
![Page 200: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/200.jpg)
200
DOCUMENT DESCRIPTION
![Page 201: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/201.jpg)
201
OUTPUT
![Page 202: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/202.jpg)
202
DOCUMENT KEYWORDS
![Page 203: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/203.jpg)
203
OUTPUT
![Page 204: Learning html Prepared By: M.Rama Bhadra Rao Assoc. Professor, MCA Department](https://reader035.vdocument.in/reader035/viewer/2022062302/568165d2550346895dd8e06a/html5/thumbnails/204.jpg)
204
KEYWORDS FOR SEARCH ENGINES
Some search engines on the WWW will use the name and content attributes of the meta tag to index your pages.
This meta element defines a description of your page: <meta name="description" content="Free Web tutorials on HTML, CSS, XML, and XHTML">
This meta element defines keywords for your page:
<meta name="keywords" content="HTML, DHTML, CSS, XML, XHTML, JavaScript, VBScript">