Page 23 - modular_v2.0_HTML&_CSS_Fb
P. 23
For example: <IMG SRC="IMAGE" WIDTH="300">
The WIDTH is the attribute of the <IMG> tag which specifies the width of the image in percentage.
By default, if the width attribute is not specified, the image is displayed at its natural width (auto).
RULES FOR WRITING HTML CODES
There are certain rules for writing HTML codes as discussed below:
Container tags should always be closed properly.
Values given to the attributes should be enclosed within the double quotes.
A tag name should not contain spaces.
There should be no spaces between a tag. For example: <TagName>.
Tags must be nested correctly.
HTML DOCUMENT STRUCTURE
A HTML document is a text file containing markup tags. The markup tags tell the Web browser
how to display the web page. A HTML file is saved with .htm or .html extension.
Basic Structure of HTML Document is as follows:
<!DOCTYPE HTML>
<HTML>
<HEAD>
<TITLE>Title of the web page</TITLE>
</HEAD>
<BODY>
Content of the page
</BODY>
</HTML>
A HTML page is divided into two sections called Head and Body.
Head contains the information which is not to be shown on the web page.
Body contains the information which is to be shown on the web page.
CREATING AND SAVING A HTML DOCUMENT
Let us start with the designing of first web page by using the basic tags.
Step 1 Open the Notepad and type the following HTML code:
<!DOCTYPE HTML>
<HTML>
<HEAD>
<TITLE>First Web Page</TITLE>
</HEAD>
<BODY>
HTML code in Notepad
21
HTML—An Introduction

