Chapter 2 Data and Expressions 24 Introduction to HTML HTML
Chapter 2: Data and Expressions
24
Introduction to HTML
HTML is the HyperText Markup Language. It is used to describe how text, images, and multimedia are displayed by Web browsers. In this lab you will learn a little about HTML so that you can create a web page containing headings, interesting fonts, lists, and links as well as applets. HTML uses tags to describe the layout of a document; the browser then uses these tags to figure out how to display the document. Tags are enclosed in angle brackets. For example, < title> is a tag that indicates that this section contains the title of the document. Many tags, including have corresponding end tags that indicate where the section ends. The end tags look just like the start tags except that they start with the character /, e.g., . So the following text indicates that the title of the document is Introduction to HTML:
Introduction to HTML
There are a few tags that almost every document will have: <html>, <head>, <title>, and <body>. Here is an example of a
simple HTML document:
<HTML>
<HEAD>
<TITLE>Introduction to HTML</TITLE>
</HEAD>
<BODY>
In this lab you will learn about HTML, which is lots of fun to
use. In particular, you will learn how to use fonts,
paragraphs, lists, links and applets in a web page. Now you
can make your own web page for your friends to visit!
To see what this looks like, open the file in the web browser.
Change the size of the browser window (click and drag any
corner) and see how the text is reformatted as the window changes. Note that the title appears on the window, not as part ofthe document.The HEAD of a document (everything between and) contains the introduction to the document. The titlegoes in the head, but for now we won\'t use the head for anything else. The BODY of a document (everything between and) contains everything that will be displayed as part of the document. Both the HEAD and the BODY are enclosed by the HTML tags, which begin and end the document. This document contains only plain text, but an HTML document can have much more structure: headings, paragraphs, lists,bold and italic text, images, links, tables, and so on. Here is a document containing a heading, two paragraphs, and some fancy fonts:
 Introduction to HTML
Introduction to HTML
In this lab you will learn about HTML, which
is lots of fun
to use. In particular, you will learn how to use fonts,
paragraphs, lists, links, and colors in a web page. Now you
can make your own web page for your friends to visit!
Later in this lab you will do some fancier stuff with
applets and graphics and include an applet on your web page.
Can\'t you just feel the job offers start rolling in?
Yippee!
Run the HTML document to see what this looks like in the browser.
In this document the
tag creates a level 1 heading. This is the biggest heading; it might be used at the beginning of the
document or the start of a new chapter. Level 2 through level 6 headings are also available with the
through
tags.
The
tag creates a new paragraph. Most browsers leave a
blank line between paragraphs. The tag creates bold text,
the tag creates italic text, and the
> tag creates underlined text. Note that
each of these tags is closed with the
corresponding end tag. The BGCO
LOR attribute on the BODY tag
sets the background color.
Note that line breaks and blank lines in the HTML document
do not matter—the browser will
format paragraphs to fit the
window. If it weren\'t for the
tag, the blank line between
the paragraphs in this document would not show up in the
displayed document.
---------------------------------------------------------------
Exercise #1:
For a file to be visible on the Web, it must be where the web server knows how to find it. *** Instruct students
how to create and/or access the public ht
ml directory on the local system. ***
Open a new file called MyPage.html in a directory where it w
ill be accessible from the web. Write a simple web page about
things that interest you. Your page should contain at least the following:
Solution
MyPage.html
<html>
 <head>
    <title>MyPage</title>
 </head>
 <body bgcolor=\"LightGray \">
    <h1 align=\"center\" >My Interests</h1>
    <h2><font color=\"red\" size=\"8\">My Name is xyz</h2></font>
    <p><font color=\"yellow\" size=\"5\">I am interest in </p>
    <ol>
    <li>Playing football</li>
    <li>Reading Books</li>
    <li>Watching Movies</li>
    <li>Listening Music</li>
    </ol></font>
    <h3>My phone numbers</h3>
    <table style=\"width:60%\" border=\"3\">
    <tr>
        <th>Name</th>
        <th colspan=\"2\">Telephone</th>
    </tr>
     <tr>
        <td>Xyz</td>
        <td>55577854</td>
    </tr>
    </table>
    <h3>Now I am learning HTML</h3>
    <p><font color=\"orange\" size=\"5\">About HTML :-HTML stands for Hyper Text Markup Language
 HTML describes the structure of Web pages using markup
 HTML elements are the building blocks of HTML pages
 HTML elements are represented by tags
 HTML tags label pieces of content such as \"heading\", \"paragraph\", \"table\", and so on
 Browsers do not display the HTML tags, but use them to render the content of the page</p></font>
    <p><b>To watch my Prizes</b></p>
    <a href=\"home.html\">Click Here</a>
 </body>
 </html>
Note :- This Example is covered font styles , links, tables, headings,lists and paragraphs if not sufficiant please comment what you need .
Thank you!



