Our Android Application, 100K+ Downloads Download
Close ads ->
Close ads ->
-->

Random Posts

Follow US

HTML Lesson Five - Attributes

Learn about different attributes in HTML, know about them and use them properly .
Share it:
Learn HTML
So we have learned few basics about HTML, in this lesson we will be learning about attributes and how to align then, their measurements etc . So lets get started .

What is an attribute ?
Attributes are used to modify and provide more information about an element or a tag . They are added to the starting tag of HTML . They appear in name="value" pairs .
You can align the text to left, center, right its up to you .

Try this example :
<p align="center">
This is an example . Here the text is aligned to center
</p>

Output :
The content will be place to the center . Like this

This is an example . Here the text is aligned to center

How to change the size etc ?
See the difference of 100px and 100% and what does it do .

Try this example :
<hr width="100px"/>
<hr width="100%"/> 

Outputs :





Okay lets try them all together .

Should try this yourself :
<p align="center">
This is an example
</p>
<hr width="100px"/>
<hr width="100%"/> 

Output :
This is an example



See the text is aligned at the center and the lines are adjusted with the measure . I think you understand this and in our next lesson we will learn about images , links etc . 
Share it:

Learn-HTML

Learn-To-Code

Post A Comment:

0 comments: