A paragraph is often a chunk of text that always begins on a new
line.


Paragraphs in HTML

Paragraphs in HTML

A paragraph in HTML is defined by the <p> element.

Browsers automatically add some white space (a margin) before and after a
paragraph, which always begins on a new line.

Example:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Paragraphs in HTML</title>
</head>
<body>
    <p>There is a paragraph here.</p>
    <p>There is a paragraph here.</p>
    <p>There is a paragraph here.</p>
</body>
</html>


HTML Format

It’s impossible to predict how HTML will look.

Different outcomes will emerge from resized windows, large displays, and
small screens.

HTML does not allow you to alter the presentation by including extra lines
or spaces.

When the page is displayed, the browser will automatically eliminate any
excess spaces and lines.

Example:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>HTML Format</title>
</head>
<body>
    <p>

        This sentence
	has numerous lines.
	in the code's source
	however, the browser
	omits it.

    </p>

    <p>

	This sentence

	contains numerous spaces

	within the source code

	however, the browser

	omits it.

    </p>
	
    <p>The size of the browser window determines how many lines there are in a paragraph. This paragraph will have a different number of lines depending on how big your browser window is.</p>
</body>
</html>


Horizontal HTML Rules

The <hr> tag, which typically appears as a horizontal rule,
designates a thematic break in an HTML page.

The <hr> element is used in HTML pages to define changes or to split
content:

Example:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Horizontal HTML Rules</title>
</head>
<body>
    <h1>The first heading.</h1>
    <p>This text is some.</p>

    <hr>

    <h2>This is second heading.</h2>
    <p>This is some different text.</p>
	
    <hr>

    <h2>This is heading 2</h2>
    <p>This is some other text.</p>
</body>
</html>

The <hr> tag has no end tag because it is an empty tag.


All Material (download)

Text Mark Project (Download)

Rate this post

Categorized in: