All HTML Tags And Attributes : Lesson 4 Part1

ADVERTISEMENTS

Welcome to the 4th lesson of the HTML and CSS Tutorial program. As we are finished with the five structure tags, now we will discuss all the HTML tags and attributes.The last 3 lessons were only theoretical but today’s lesson needs a lot of practice in order to learn the HTML tags. So, while reading each and every tag, try to practice it simultaneously.

1. Break Tag

Break tag is used to move text or images to a new line.

Syntax

Hello friends, my name is Gagan <br> And I blog at BeepTheGeek <br/>

Output

Hello friends, my name is Gagan
And I blog at BeepTheGeek

2. Paragraph Tag

This tag is same as the break tag but the difference is that it is used to move text and line to new paragraph.

Syntax

Hello friends, my name is Gagan <p> And I blog at BeepTheGeek </p>

Output

Hello friends, my name is Gagan

And I blog at BeepTheGeek

Attributes for both Break and Paragraph Tag

  1. Align=”Left”
  2. Align=”Center”
  3. Align=”Right”

To give some extra effect to break and paragraph tag we use the three above told attributes.

Syntax

Hello friends, my name is Gagan
<p align="center">And I blog at BeepTheGeek </p>

Output

Hello friends, my name is Gagan

And I blog at BeepTheGeek

3. Heading Tag

To give heading to a paragraph we use the heading tag, please do not confuse the head tag <head> with this heading tag. That head tag is a structure tag and this heading tag is used to give heading. It has six levels, H1 is largest and H6 is the smallest.

Syntax

<h1> This is H1 tag </h1>

<h2> This is H2 tag </h2>

<h3> This is H3 tag </h3>

<h4> This is H4 tag </h4>

<h5> This is H5 tag </h5>

<h6> This is H6 tag </h6>

Ouput

This is H1 tag

This is H2 tag

This is H3 tag

This is H4 tag

This is H5 tag
This is H6 tag

Attributes for Heading Tag

  1. Align=”Left”
  2. Align=”Center”
  3. Align=”Right”

To give some extra effect to heading tag we use the three above told attributes.

Syntax

 <h6 align="center"> Hello friends, my name is Gagan </h6>

Output

Hello friends, my name is Gagan

In this way you can add align left and align right attribute.

4. Text formatting Tags

Here is a list of all the tags that are used to format the text.

<b> : Used to make text look bold

<i> : Used to make text look italic

<u> : Used to make text look underlined

<blink> : Used to make text blink

<strong> : Used to make text look more strong, works same as bold tag

<em> : Known as Emphasis tag, used to apply emphasis on text

<cite> : Used to indicate citations

<sup> : Known as Superscript tag and is used to format text as superscript, for example 42 = 16

<sub> : Known as subscript tag and is used to format text as subscript, for example log10 = 1

<v> : Used to display variables

<code> : This tag is used to display the codes of program

<strike> : Used to create strikethrough to text. For example, War

Below is a common syntax to use all the tag above

<tag name> Gagan </tag name>

That’s all in this part we’ll discuss the rest of the tags in Lesson 4, part2


If you like this post, you will love these :

  1. All HTML Tags And Attributes : Lesson 4 Part2
  2. Welcome To HTML Tutorials : Introduction : Lesson 1
  3. Starting With Five Structure HTML Tags : Lesson 3
  4. HTML Editors, Internet Browsers and W3C : Lesson 2
  5. Understanding URLs and Linking : Lesson 5

Gaganpreet Singh on August 6, 2009 | Filed Under Series

{ 7 comments… read them below or add one }

1 Nihar August 7, 2009 at 4:16 pm

Nice tutorial.

this 4th lesson is little big. Good that you covered a lot in this lesson.

Reply

2 Dan* August 7, 2009 at 6:19 pm

gud going !! 100% understood ;-)

Reply

3 Swashata August 7, 2009 at 6:30 pm

Dude I think you should really consider giving modern HTML tuts! Coz all these align tags are even deprecated in HTML 4 also! We use style instead! So think there is no point of learning these code even for newcomers :) Please don’t misunderstand me! I myself have learned modern HTML only :) Also can you tell me from where you get the closing of a <br>…Content…</br> in this style! I used to know, that in xHTML only we need to self-close it <br /> and in HTML it is left open :)

Reply

4 Gagan August 8, 2009 at 8:19 am

yea, I think I write it wrong, thanks for the correction, Yea there is no need to close the br tag in html but I wrote it because most of the bloggers have blog hosted on blogspot/blogger and they uses xhtml and they will find easy to edit their template.

As you said that you yourself have learned modern HTML only, I think you might have started from simple tags only. I’ll come to styles later. If you think these tutorials are useless and there is no point learning them, you may press ctrl+w (kiddin)

Reply

5 sham August 8, 2009 at 9:35 pm

I am waiting for table tutorial:)

Reply

6 Widewebway August 11, 2009 at 9:44 pm

Nice framed and arranged explanation…

Reply

7 Hosted Call Center October 21, 2009 at 8:39 pm

Hi, i really want to learn HTML, & this post is very helpful for me for learning HTML. Thanks……. :)

Reply

Leave a Comment

Previous post:

Next post: