Ticker

6/recent/ticker-posts

Header Ads Widget

Responsive Advertisement

HTML Tags, Elements and Attributes

 

HTML Tags, Elements and Attributes

In the previous section, we have studied the basic structure of HTML. And We have created a first "Welcome page" in HTML with the help of Notepad application.

In this section, we will study about the all basic HTML tags that always help a web developer to develop web application.


Tags vs Elements vs Attributes vs Attribute Values in HTML:

HTML Tags: 

Tags are the starting and ending parts of an HTML element. They begin with < symbol and end with > symbol. Whatever written inside < and > are called tags.

Example:

          <b></b> Bold Tag


HTML Elements: 

An element in HTML represents some kind of structure or semantics or expression. Elements enclose the contents in between the tags. It generally consists of a start tag, content, and an end tag.

Example:

<b>This is the content within bold HTML tag</b>

Where, <b> is the opening tag and </b> is the closing tag.

 

HTML Attributes And Attribute Values: 

An attribute defines a property for an element, consists of an attribute/value pair, and appears within the element’s start tag. An element’s start tag may contain any number of space separated attribute/value pairs.

 

The most popular misuse of the term “tag” is referring to alt attributes as “alt tags”. There is no such thing in HTML. Alt is an attribute, not a tag.

Example:

<p align=”left”>This is left aligned paragraph content</p>

 

All attributes are made up of two parts:

·        name

·        value

Example:<p align=”left”>This is left aligned paragraph content</p>

Ø   Name: The name is the property you want to set. For example, the paragraph element in the example carries an attribute whose name is align, which you can use to indicate the alignment of paragraph with value – Left, Right, Center, and Justify etc. on the page.

 

Ø   Value: The value is what you want the value of the property to be set and always put within quotations. The below example shows three possible values of align attribute: left, center and right.


Example: Description of HTML Tag, Element and Attribute.




 Explanation of HTML Tag, Element and Attribute.

HTML TAGS

HTML ELEMENTS

HTML ATTRIBUTES

HTML tags are used to hold the HTML element/content.

HTML element holds the content.

HTML attributes are used to describe the characteristic of an HTML element in detail.

HTML tag starts with < and ends with >

Whatever written within a HTML tag are HTML elements/contents.

HTML attributes are used only in the opening tag.

HTML tags are almost like keywords where every single tag has unique meaning.

HTML elements specifies the general content.

HTML attributes specify various additional properties to the existing HTML element.

Example:

<b></b> Bold Tag

Example:

<b>This is the content within bold HTML tag</b>

Where, <b> is the opening tag and </b> is the closing tag.

 

 

Example:

<img src="foobar.gif" alt="A foo can be balanced on a bar by placing its fubar on the bar's foobar.">

 

 

 





आशा करते है कि हमारे द्वारा लिखी हुई इस Post को आप Like, Share and Comment करेंगे | और हमें Comment करके बताये की आपको ये Post कैसी लगी | इसी तरह की Post और News पाने के लिए हमारे सभी Social Media Channels को रेगुलर Follow करे| 


Thanks
Amar Digital World
(Always Ready To Digital Serve)

Post a Comment

0 Comments