DETAILS

HTML Headings And Paragraphs

HTML Headings And Paragraphs Photo

HTML Headings And Paragraphs

HTML Headings:

Any document starts with a heading. You can use different sizes for your headings. HTML also has six levels of headings, which use the elements <h1>, <h2>, <h3>, <h4>, <h5>, and <h6>. While displaying any heading, the browser adds one line before and one line after that heading.

CODE:

HTML Headings

 

Result:

Result

Headings Are Important:
Search engines use the headings to index the structure and content of your web pages. Users often skim a page by its headings. It is important to use headings to show the document structure.

Bigger Headings:
Each HTML heading has a default size. However, you can specify the size for any heading with the style attribute, using the CSS font-size property:

CODE:

Bigger Headings

RESULT:

RESULT

HTML Horizontal Rules:
The <hr> tag defines a thematic break in an HTML page and is most often displayed as a horizontal rule. The <hr> element is used to separate content (or define a change) in an HTML page:

CODE:

HTML Horizontal Rules

 

RESULT:

RESULT

Paragraph:
The <p> tag offers a way to structure your text into different paragraphs. Each paragraph of text should go in between an opening <p> and a closing </p> tag.

CODE:

Paragraph

 

RESULT:

RESULT

 

Break <br> tag:
There is a way to let the HTML know where does the browser need to change the lines by the use of <br> tag. These tags do not have any closing tag. So, just a single opening tag will change the line.

CODE:

Break

 

RESULT:

RESULTThe <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 an <pre> element is displayed in a fixed-width font (usually Courier), and it preserves both spaces and line breaks:

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

CODE:

The HTML

 

RESULT:

Result

Dis