Page 38 - DCAP202_Fundamentals of Web Programming
P. 38
Unit 3: HTML Command and Structure
3.2.2 !DOCTYPE Declaration Notes
Every well written HTML document begins with a basic declaration that defines what type of
document it is. This declaration is made using the!DOCTYPE tag and is to be written at the
beginning of the document. It tells the processing agent and HTML version. Sample is shown
below.
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.0//EN”>
Self Assessment
Fill in the blanks:
7. A HTML ........................... is basically separated in two parts: the head and the body .
8. Every well written HTML document begins with a basic declaration that defines what
type of document it is and this declaration is made using the ........................... tag.
3.3 Text Formatting Tags
After any length of time on the Internet, you’ll notice that a Web page is made up of more than
just plain words on a screen. There are headlines, paragraphs, graphics, colors and much more.
It’s a lively place to be.
Our next tags—headline, paragraph, line break and horizontal rule—will help us make our
current page a lot more exciting.
3.3.1 Paragraph Breaks <P>
To add space between paragraphs you use the paragraph tag:
<p>…</p>
This is a container tag and must have a beginning and an ending.
To add a single line of space, you use break tag:
<br>
This is an empty tag and stands alone. You can use the <br> tag to insert one or more blank lines.
3.3.2 Horizontal Rules <HR>
To create a horizontal line on your page you use the empty tag:
<hr>
3.3.3 Heading Styles
In HTML, bold copy is created by using the headline tag. There are six levels of headlines,
ranging from <h1>…</h1> to <h6>…</h6>.
Here is an example of the code for all the headline sizes:
<h1>Level 1 Headline</h1>
<h2>Level 2 Headline</h2>
LOVELY PROFESSIONAL UNIVERSITY 31