HTML Elements continued... - Ashutosh

Hot

Post Top Ad

Saturday, September 9, 2017

HTML Elements continued...

Hello,  Everyone Myself Ashutosh And today you learn about HTML Elements ..







HEADINGS

  Headings are defined with the <h1> to <h6> tags. <h1> defines the largest headings.<h6> defines the smallest headings.

<h1> This is a heading </h1>
<h2> This is a heading </h2>
<h3> This is a heading </h3>
<h4> This is a heading </h4>
<h5> This is a heading </h5>
<h6> This is a heading </h6>

HTML automatically adds on extra blank line before and after a heading.


PARAGRAPHS

Paragraphs are defined with the <p> tag.

<p> This is a paragraph </p>
<p> This is another paragraph </p>

HTML automatically adds an extra blank line before and after a paragraph.

Don't Forget The Closing Tag

You migh have learned that paragraph can be written without and tag <p>
<p> This is a paragraph
<p> This is a another paragraph

The example above will work in most browser. but don't want on it . Future version of HTML  will not allow you to skip ANY and tags . Closing all HTML elements which an end tag is a future- proof way of writing HTML .It also makes the codes consist to understand (read and browse) when you work both where an element start and where it ends.

LINE BREAKS

The <br> tag is used when you want to break a line,but don't want to short a new paragraph. The <br>  forces a line break wherever you placed it.

<p> This<br> is a para<br>graph with line break <p>

The <br> tags is an empty tags. It has an end tag like </br> since the closing tag doesn't make any sense.

<br> or <br />
More and More often you will see the <br> tag written like this <br/>

Because the <br> tag has an end tag (or closing tag)  it breaks one of the rules for future HTML (the XML or XHTML). Namely that all elements must be closed .writing it like < br/> is a future proof way of closing (or ending)  the tag inside the opening tag. accepted by both HTML and XML.

Comments in HTML

The comment tag is used to insert a comment in the HTML source code. A comment will be ignored by the browser. You can use comments to explain you code, which can help when you edit the source code at a later date.

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

Note that you need an explamation point after the opening bracket but not before the closing bracket.


Written With heart💙


Thanks

Subscribe - www.ashutosh000.blogspot.com

Created by Ashutosh