Web Design Lesson 007 – Comments and Quotations

HTML Comment Tags

Like in any other programming language, there is a feature to comment HTML statements . It can span multiple lines. Following is the syntax:

<!-- This is a comment.  -->

Check the output of following code:

<html>
<head></head>
<body> 
<h1 style="color:blue;">This is a heading</h1>
<!--<p style="color:green;">This is a paragraph.</p>-->
</body>
</html>

And this too:

<html>
<head></head>
<body> 
<!--<h1 style="color:blue;">This is a heading</h1>
<p style="color:green;">This is a paragraph.</p>-->
</body>
</html>

Quotations

There are two elements to write quotations:

1) <q> Element specifies short quotations in double quotes.

Try the following code:

<html>
<head></head>
<body>
The teacher said to me in class , <q> Learn this:
 Prevention is better than cure, 
Curiosity killed the cat  and Early to bed and early from bed makes a man healthy,wealthy and wise. </q>
</body>
</html>

2) <blockquote> defines a separate section for quotations.This is useful when writing larger quotations:

 <html>
<head></head>
<body>
The teacher said to me in class , <q> Learn this:
 Prevention is better than cure, 
Curiosity killed the cat  and Early to bed and early from bed makes a man healthy,wealthy and wise. </q>
</body>
</html>

The HTML <blockquote> element defines a section that is quoted from
another source.

<html>
<head></head>
<body>
The teacher said to me in class , <blockquote> Learn this:
 Prevention is better than cure, 
Curiosity killed the cat  and Early to bed and early from bed makes a man healthy,wealthy and wise. </blockquote>
</body>
</html>

You can add attributes to this eg. <blockquote cite=”http://reliabledesigner.com/”> Reliable Designer – Design Tips and Guides &;lt;/blockquote>
to indicate the source of the citation.

Leave a Reply

Your email address will not be published. Required fields are marked *