What is HTML attributes with Example
HTML attributes Kya hai
เคिเคคเคจे เคญी HTML tags เคนोเคคे เคนै เคเคจ เคธเคฌเคे attributes เคนोเคคे เคนै। เคฏे name เคเคฐ value เคे pair เคฎें เคฒिเคे เคाเคคे เคนै। Attributes เคे เคฆ्เคตाเคฐा เคเคช tags เคो เค
เคชเคจे according configure เคเคฐ เคธเคเคคे เคนै। Attributes เคो เคนเคฎेเคถा starting tag เคฎें define เคिเคฏा เคाเคคा เคนै। เคเคจ्เคนे define เคเคฐเคจे เคा เคเคฆाเคนเคฐเคฃ เคจिเคे เคฆिเคฏा เคा เคฐเคนा เคฅा।
| <tagName attrName="value"> some text here. </tagName> |
Attributes advanced configuration เคे เคฒिเค เคฏूเฅ เคिเคฏे เคाเคคे เคนै। เคैเคธे เคी เคเคช default page background เคจเคนीं เคाเคนเคคे เคคो เคเคธเคो เค เคชเคจे according change เคเคฐ เคธเคเคคे เคนै। เคเคธे เคนी เคเคช เคฏเคฆि default text color เคจเคนीं เคाเคนเคคे เคนै เคคो เคเคธे เคญी change เคเคฐ เคธเคเคคे เคนै। Attributes เคो เคฏूเฅ เคเคฐเคจा เคฌเคนुเคค เคนी simple เคนै। เคฌเคธ เคเคชเคो เคชเคคा เคนोเคจा เคाเคนिเค เคी เคौเคจเคธा attribute เคिเคธ เคเคเคน เคฏूเฅ เคเคฐเคจा เคนै। เคเคे attributes เคธे related เคเค simple เคเคฆाเคนเคฐเคฃ เคฆिเคฏा เคा เคฐเคนा เคนै।
| <html> <head> <title>myPage</title> </head> <body bgcolor="black"> <h1 style="color:pink"> Heading </h1> <p style="color:yellow"> This is a paragraph. And you are learning html in Hindi. </p> </body> </html> |
เคเคชเคฐ เคฆिเค เคนुเค example เคฎें 2 เคเคเคน attributes เคฏूเฅ เคिเคฏे เคเค เคนै। เคธเคฌเคธे เคชเคนเคฒे <body> tag เคฎें bgcolor attribute เคฏूเฅ เคเคฐเคคे เคนुเค page เคा background color define เคिเคฏा เคเคฏा เคนै। เคเคฌ เคเคช default body tag เคฏूเฅ เคเคฐเคคे เคนै เคคो page เคा background color white เคฐเคนเคคा เคนै। เคฒेเคिเคจ เคैเคธा เคी เคฎैเคจे เคเคชเคो เคฌเคคाเคฏा เคी เคเคช attributes เคे เคฆ्เคตाเคฐा page เคเคฐ text เคเคช เค เคชเคจे according configure เคเคฐ เคธเคเคคे เคนै। เคเคธ attribute เคे เคฆ्เคตाเคฐा เคเคช เคो background เค เคชเคจे page เคा เคฐเคเคจा เคाเคนเคคे เคนै เคตो เคฐเค เคธเคเคคे เคนै। เคैเคธे เคी เคฎैเคจे example เคฎें black เคฆिเคฏा เคนै।
เคฆूเคธเคฐा attribute paragraph tag เคฎें เคฏूเฅ เคिเคฏा เคเคฏा เคนै। เคฏे style attribute เคนै। เคเคธ attribute เคे เคฆ्เคตाเคฐा เคเคช tag เคชเคฐ CSS (Cascading Style Sheet) apply เคเคฐ เคธเคเคคे เคนै। CSS เคे เคฆ्เคตाเคฐा advanced configuration เคिเคฏा เคाเคคा เคนै, เคिเคธเคे เคฌाเคฐे เคฎें เคเคช เคเคे เคชเฅेंเคे। เคैเคธे เคी เคเคช เคฆेเค เคธเคเคคे เคนै style attribute เคे เคฆ्เคตाเคฐा CSS apply เคिเคฏा เคเคฏा เคนै। เคเคธเคธे text เคा color change เคिเคฏा เคाเคคा เคนै। เคเคฐ เคเคธा เคนी heading tag เคे เคธाเคฅ เคญी เคिเคฏा เคเคฏा เคนै।
Scope of attributes
Attributes เคा scope เคเคจเคे tags เคे according เคนोเคคा เคนै। เคिเคธ tag เคे เคธाเคฅ เคเคช เคो attribute apply เคเคฐเคคे เคนै เคตो เคเคธी tag เคคเค เคฐเคนเคคा เคนै। เคैเคธे เคी เคเคชเคจे body tag เคฎें style tag เคो เคฏूเฅ เคเคฐเคคे เคนुเค text color red define เคिเคฏा เคนै। Body tag เคชुเคฐे page เคे เคฒिเค เคนोเคคा เคนै เคเคธเคฒिเค เคฏे attribute เคชुเคฐे page เคे text เคो red เคฎें show เคเคฐेเคा। เคฒेเคिเคจ เคเคธा เคคเคฌ เคคเค เคนी เคนोเคा เคเคฌ เคคเค เคोเค body tag เคธे เคोเคा tag text เคो เคฆूเคธเคฐे color เคฎें define เคจเคนीं เคเคฐเคคा เคนै। เคैเคธे เคी เคเคช เคเคे เคเคฒเคเคฐ เคिเคธी paragraph tag เคा color green define เคเคฐเคคे เคนै। เคคो เคฏे color body tag เคे color เคो override เคเคฐेเคा। เคเคฐ เคเคชเคा เคฏे paragraph green text เคฎें show เคนोเคा। เคเคธเคा เคเคฆाเคนเคฐเคฃ เคจिเคे เคฆिเคฏा เคा เคฐเคนा เคนै। เคเคธे เคเคช execute เคเคฐเคตा เคเคฐ เคฆेเค เคธเคเคคे เคนै।
| <html> <head> <title> myPage </title> </head> <body style="color:red"> Learn html in Hindi <br> Lean html in Hindi in 2 days. <br> Learn html in Hindi pdf. <p Style="color:green"> This is some text here </p> </body> </html> |
เคเคชเคฐ เคฆिเค เคนुเค เคเคฆाเคนเคฐเคฃ เคฎें เคเคช เคฆेเค เคธเคเคคे เคนै เคी paragraph เคा text color เค เคฒเค เคธे define เคिเคฏा เคเคฏा เคนै। เคฏे body เคे text color เคो override เคเคฐเคคा เคนै। HTML attributes เคो เคฏूเฅ เคเคฐเคจे เคी เคुเค guide line เคนोเคคी เคนै। เคिเคจเคो follow เคเคฐเคे เคเคช attributes เคा เคฌेเคนเคคเคฐ เคเคธ्เคคेเคฎाเคฒ เคเคฐ เคธเคเคคे เคนै। เคเคจเคे เคฌाเคฐे เคฎें เคจिเคे เคฆिเคฏा เคा เคฐเคนा เคนै।
Guidelines for using HTML attributes
- เคนเคฎेเคถा attributes เคो lower case เคฎें define เคเคฐे।
- เคนเคฎेเคถा attributes เคी values quotation mark เคฎें เคนी define เคเคฐे।
Most Popular HTML attributes
เคจिเคे เคเคชเคो HTML เคฎें commonly เคฏूเฅ เคนोเคจे เคตाเคฒे attributes เคी list เคฆी เคा เคฐเคนी เคนै।
| Attribute | Explanation | Example |
id | HTML document เคฎें เคिเคธी tag เคो uniquely identify เคเคฐเคจे เคे เคฒिเค id attribute เคฏूเฅ เคिเคฏा เคाเคคा เคนै। เคिเคจ्เคนी 2 tags เคी id same เคจเคนीं เคนो เคธเคเคคी เคนै। | <p id="mypara"> |
class | เคฏे attributes tags เคो เค เคฒเค เค เคฒเค class เคฎें categories เคเคฐเคจे เคे เคฒिเค เคฏूเฅ เคिเคฏा เคाเคคा เคนै। เคฌเคนुเคค เคธे tags เคเค class เคे เคนो เคธเคเคคे เคนै। | <h1 class="java"> |
title | เคिเคธी tag เคा tittle เคฆेเคจे เคฆेเคจे เคे เคฒिเค title attribute เคฏूเฅ เคिเคฏा เคाเคคा เคนै। | <p title="Hello"> |
style | เคเคธ attribute เคे เคฆ्เคตाเคฐा เคเคช tag เคชเคฐ style rules apply เคเคฐ เคธเคเคคे เคนै। | <p style="color:red |
เค
เคเคฐ เคเคช เคो เคนเคฎाเคฐा เคฏเคน Artical เคैเคธा เคฒเคा comments เคे เคฆ्เคตाเคฐा เคเคฐूเคฐ เคฌเคคाเค เคเคฐ เคเคธ เคเคฐ्เคिเคเคฒ เคो เคถेเคฏเคฐ เคเคฐे
.png)



