Unit 1.2 HTML - Basic
Unit 1.2 HTML - Basic
Purpose
Provide an easy way to access cross-referenced documents
that exist on the internet
Directory
Filename
Text to be displayed
<tag attribute=“value”>some
text</tag>
<HTML>...</HTML>
Example:-
Syntax
<HEAD>...</HEAD>
Example
<HEAD>
<TITLE> Mozilla speaks out</TITLE>
<BASE HREF="http://www.mozilla.com">
</HEAD>
The TITLE tag defines the TITLE of the document. This is what is
displayed in the top of your browser window. In addition, many
search engines use this as their primary name of a document.
Syntax
<TITLE>...</TITLE>
Example
<HEAD>
<TITLE> Mozilla speaks out</TITLE>
</HEAD>
<html>
<head></head>
<BODY BGCOLOR=“green" TEXT="black“ LINK="blue"
VLINK="green“ ALINK="red">
<p> this is just <a href="a.htm"> For </a> testing. </p>
<h1 style="color:blue;text-align:center">This is a
header</h1>
<p style="color:green">This is a paragraph.</p>
</BODY>
</html>
Paragraph Tag
<html>
<body>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
</body>
</html>
Heading Tags
The <h1> to <h6> tags are used to define HTML
headings.
<h1> defines the most important heading. <h6>
defines the least important heading.
<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><b>Tip:</b> Use the h1 to h6 tags only for headings. Do not use them just to make
something bold. Use other tags for that.</p>
</body>
</html>
BR
If the Paragraph element usually has white space around it, how do
you "carriage return" only one line? The BR element inserts a "line
break" in the text.
Example:-
<html>
<body>
<p>
I’d like to write some text<br>and then have the next bit on the line
below.
</p>
</body>
</html>
<html>
<body>
<p>Here’s part of my page.</p>
<hr>
<p>And here’s another bit, distinguished by the line
above.</p>
</body>
</html>