HTML Paragraphs

The HTML <p> element defines a paragraph:

HTML paragraphs are defined with the <p> tag:

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>

<p>This is paragraph.1</p>
<p>This is paragraph.2</p>

</body>
</html>

Note: Browsers automatically add some white space (a margin) before and after a paragraph.

Don't Forget the End Tag

Most browsers will display HTML correctly even if you forget the end tag:

HTML Line Breaks

The HTML <br> element defines a line break.
Use <br> if you want a line break (a new line) without starting a new paragraph:



<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>

<p>This is<br>a paragraph<br>with line breaks.</p>


</body>
</html>

The <br> tag is an empty tag, which means that it has no end tag.


The HTML <pre> Element

The HTML <pre> element defines preformatted text.
The text inside a <pre> element is displayed in a fixed-width font (usually Courier), and it preserves both spaces and line breaks:



<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>

<pre>
  This is paul Tutorila.

This is paul Tutorila.
This is paul Tutorila.
</pre>


</body>
</html>


Summery:


<p>  Defines a paragraph
<br> Inserts a single line break
<pre> Defines pre-formatted text

No comments:

Post a Comment

How to Create Check and Uncheck - Radio Button ?

<script> var grd = function(){   $("input[type='radio']").click(function() {     var previousValue = $(this).attr(...

Popular Posts