#4 HTML Course | What are Tags and attributes? | HTML for beginners Part-4

#4 HTML Course | What are Tags and attributes? | HTML for beginners Part-4

Tags :-

Tag is a symbol in HTML, this has some special meaning. It is made up of keywords written between 2 arrows heads < and >. HTML tag is a signal to the browser that it should do something other than just throwing text upon the screen.

Examples for Tags are :-> <HTML>, <BODY>, <Head>, etc.

Attributes :-

These are the specification of particular tag that define its style, such as in Body tag an attribute may define color of text, color of hyper-text image, etc.

Examples :-> 

<body bgcolor="red">

Here, bgcolor is used as the attribute of body tag which is used to change background colour.

Note :->

  • If attributes are not used, even then, the tag will work but sometimes they becomes necessary as without them, There is no significant information will be provided to the browser of using such tags.
Example :- src attribute of <img> tag is necessary for image path delcaration.
  • We can also use multiple attributes by giving space between them.
Example :- <Body bgcolor="red" Text="blue" >

0 Comments: