Ads

Breaking

Tuesday, July 21, 2020

HTML attributes








HTML attributes are the special words which when used change the behavior of element's . html attributes are used inside the opening tags . HTML is a modifier of an element type .


all attributes are made up of two parts :-
a. Name :- It is a property you want to set e.g. <p> paragraph is carrying a name align , which you are going to use to indicate the alignment of paragraph on the page .

b.Value :- It is the value of a name to be set and is always written within quotations . e.g. example shows the possible values for align attributes i.e. left , right , center . 

Process to use this attribute is shown below :-

1. Open your text editor .

2. Write basic tags i.e. html , head , body . use title tag to write "Attribute example" in head section in order to understand which type of document you have made .



3.Write the paired paragraph tag inside body tag i.e. <p> and </p> and write paragraph you want to show the user in the main browsing area , to show I am writing "<p>this paragraph is on the left</p> , <p>this paragraph is on the center</p> , <p>this paragraph is on the right </p>" .



4. Save this file with . html extension . I am saving this file as "attribute_example.html" .







5. To see the result how this looks like open the saved file in any browser to see the result . In point number 6 we will be using attributes to  see the difference in the result .



6. Use attribute i.e. align tag in the body section with <p> tag to see the change in behavior of the element like "<p alight="left">this paragraph is on the left . </p> , <p align="center">this paragraph is on the center .</p> , <p align="right">this paragraph is on the right .</p>"







7. Save the file as "attribute_example1.html" .



8. Open the saved file in any browser to see the result of attribute example .


Related Post :-                                                                        

No comments:

Post a Comment