HTML Tags, Attribute and Elements

Let’s talk about HTML Tags, Attributes and Elements briefly.
1: TAGS:
All the content, layout and structure which you see on your web page is because of these tags everything you type or do in between these tags shows up on you webpage. You can say they are like a switch which tells the browser to apply the meaning of what is written inside.
Every Tag in html has an opening and closing tag such as <p>(Opening tag) </p> (Closing Tag). but there are 2 tags which have no closing <br> (Used for line-break) and <hr> (used for putting a horizontal line).


2: ATTRIBUTES:
HTML tags can have attributes or more precisely you can say properties of Tags which add some extra designing and layout to the content in between these tags for example:
We want to change the color of our paragraph our background color of our web page the property we will use for that is called attribute as shown in image.


 OUTPUT



As you can see that the background color of the page is changed to grey and text color as well when we run the code and if you hover your mouse over the 1st line you can see that the title is there.


3: ELEMENTS:
We read about Tags i hope know you have the Idea what Tags are. Now if we talk about ELEMENTS that’s very easy whatever comes in between opening and closing tag is called it’s Element for example
<p>whatever we will type in here is Element</p>
<h1>Also element</h1>

Now you know what tags, elements and attributes are in next tutorials we will use attributes a lot.
Previous
Next Post »