HTML Examples
HTML Examples
<!DOCTYPE html>
<html>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>
The <!DOCTYPE> declaration represents the document type, and helps browsers to display web
pages correctly. It must only appear once, at the top of the page (before any HTML tags).
The <!DOCTYPE> declaration is not case sensitive.
Every Html page should start with <html> and the page should end with </html>
<body> Tag defines body part of the Html page
<h1> is used for Heading in the page and should end with </h1> tag
You can try
<!DOCTYPE html>
<html>
<body style="background-color:powderblue;">
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
<body style="background-color:powderblue;"> defines background
The <font> tag comes in pairs. The content is written between the opening (<font>) and closing
(</font>) tags.
Simple Html page with Link attributes
<!DOCTYPE html>
<html>
<body>
<h2>HTML Links</h2>
<p>HTML links are defined with the a tag:</p>
<a href="PATH OF EXAMPLE1.HTML">This is a link</a>
</body>
</html>
Example of html with input
<!DOCTYPE html>
<html>
<body>
<h2>HTML Input </h2>
<form action="/action_page.php">
<label for="fname">First name:</label>
<input type="text" id="fname" name="fname"><br><br>
<label for="lname">Last name:</label>
<input type="text" id="lname" name="lname"><br><br>
<input type="submit" value="Submit">
</form>
</body>
</html>
The <input> tag specifies an input field where the user can enter data.
The <input> element is the most important form element.
The <input> element can be displayed in several ways, depending on the type attribute.
<form action="/action_page.php">
<p>Please select your favorite Web language:</p>
<input type="radio" id="html" name="fav_language" value="HTML">
<label for="html">HTML</label><br>
<input type="radio" id="css" name="fav_language" value="CSS">
<label for="css">CSS</label><br>
<input type="radio" id="javascript" name="fav_language" value="JavaScript">
<label for="javascript">JavaScript</label>
<br>
</body>
</html>
In the above example the <input type="radio"> defines a radio button.
Radio buttons are normally presented in radio groups (a collection of radio buttons describing a
set of related options). Only one radio button in a group can be selected at the same time.
Note: The radio group must have share the same name (the value of the name attribute) to be
treated as a group. Once the radio group is created, selecting any radio button in that group
automatically deselects any other selected radio button in the same group. You can have as many
radio groups on a page as you want, as long as each group has its own name.
Note: The value attribute defines the unique value associated with each radio button. The value
is not shown to the user, but is the value that is sent to the server on "submit" to identify which
radio button that was selected.
The Phases of Web Site Development
Planning:
Setting goals, specifying content, organizing content,
and setting the user interface to navigate content
Implementing:
Creating content, implementing navigation and the
user interface, and coding the site, which may include
HTML, programming, and Database development
Testing:
User, browser, and system testing
Maintenance:
Maintaining and updating the site, questioning old
goals, and returning to the planning stage
HTML Documents and Tags
Paired Tags:
The <B> tag is a paired tag. The <B> tag with its
companion tag </B>. This causes the text contained
between them to be rendered in bold.
Singular Tags:
This is the singular tag or stand-alone tag.
<BR> tag will insert a line break. This tag does not
require any companion tag.
The Structure of HTML Document
<! DOCTYPE HTML PUBLIC “html version”>
<HTML>
<HEAD>
<TITLE>Document Title</TITLE>
……Other supplementary information goes here….
</HEAD>
<BODY>
….Marked-up text goes here………..
</BODY>
</HTML>
Every HTML document starts with <HTML> tag and ends with
</HTML>.
LINKING DOCUMENTS: