Artikel Terbaru

header ads

HTML TUTORIAL: ATTRIBUTES

HTML TUTORIAL IN HINDI

HTML TUTORIAL: ATTRIBUTES

  • Introduction to Attributes
  • Guidelines for Using HTML
  • Commonly or Global Attributes

INTRODUCTION TO ATTRIBUTE

HTML tags ki use karke HTML document bana sakte hai. HTML document ki background white and Text black color ki hoti hai. To attributes use karke aasani se sb kuch change kar sakte hai. HTML me jitne bhi tags hai un sab ka attributes hai. Attribute ko ek simple word me samajhte hai ki attribute kya hai.

“HTML me attribute wah techniques hai jinke through ham apne elements ka additional information provide karate hai”


Agar aap ek webpage banane ki soch rahe hai ya banaya hai to aap nahi chahte ki uski color default ho, agar aisa hai to attribute ki madat se aap tags ke andar ke content ko apne anusar configure kar sakte hai.

TYPES OF ATTRIBUTES:

Types of attributes ki baat kare to yah 3 type ki hai. Iski list aur details jankari niche dee gayi hai.
  • Required attributes
  • Standard Attributes
  • Even Attributes

Required Attributes

Required attributes ko aap optional attributes bhi kah sakte hai. Iska uses yah hai ki koi HTML element ko modify karna.
Example:
<a href= “site link”> Click </a>
<a> ek tag hai. jiska use HTML me hyperlink ke liye use karte hai. href ek required ya optional attributes hai.

Standard attributes

Standard attribute ko global attribute bhi kahte hai yani yah attribute globally use hota hai. Khaskar HTML element me.

Event Attribute

Event means yahi hai ki koi particular time. Event attribute ka use kisi bishes (विशेष) kaam ke liye use kiya jata hai.

SYNTAX OF HTML ATTRIBUTES

HTML attributes ki do bhaag hote hai , attribute name aur attribute value. HTML ki general syntax niche dee gayi hai.
<tagName attrName= “value”>
Content here
</tagName>
HTML attributes general syntax me dekha ki attribute hamesa starting tag me define kiya jaata hai. Attribute name me aap HTML tag ki property ko define karta hai ki aap kya set karna chahte hai. Jaise: img src, href etc. attribute value me us property ki value ko define kar  karta hai, image, link, paragraph etc.

HTML FIRST PROGRAM WITH ATTRIBUTES

Attribute ko hamesa starting tag me define kiya jaata hai aur attribute ko use karna bhut hi aasan hai. Aapko attribute ki name aur uski value aadh honi chahiye.
Example:
<!DOCTYPE html>
<html>
<head>
<title> This is my first program</title>
</head>
<body bgcolor= "blue">
<h1 style= "color:red"> Heading 1</h1>
<h2 style= "color:yellow"> Heading 2</h2>
<p style="color:orange">
this is my first program
</p>
</body>
</html>
Result:
HTML Attribute, HTML, HTML tutorial in hindi

Upper ki example aur result me dekh sakte hai ki jaha-jaha aap attribute use karenge waha-waha apply hoga. Agar HTML page banana hai to uski background color white rahti hai magar waha mene blue diya hai, waha ek attribute us e huwa hai.

GUIDELINES FOR USING HTML ATTRIBUTES

Harek chij ki ek apna rule rahti hai tabhi jakar ache se kaam karte hai waise hi attributes ka bhi kuch apna rule hai jise follow karke use karna hota hai.
  •  Attributes ko lower case me define karte hai.
  •  Attributes ki values quotation mark me define karna hota hai.

COMMONLY OR GLOBALLY ATTRIBUTES

HTML me kuch attributes dusre ke mukable jyada use hota hai. Niche commonly use hone wali attributes ki list dee gayi hai.

Href:

Href attributes ki madat se kisi bhi link ki URL likh sakte hai.
Syntax:
<a href= “URL link”> Name</a>

Src

Yah attribute href ki taraha hi kaam karti hai.
Syntax:
<img src= “image.jpg”>

Id

Id attributes ki madat se kisi bhi tag ki unique id define kar sakte hai.
<tagName id= “id-here”> other content </tagName>

Style

Style attribute ki use kisi tag par inline CSS rule apply karne ke liye kiya jaata hai.
Syntax:
<tagName style= “rule:value”>content </tagName>

Class

Class attribute bhi id attribute ki class define karne ke liye use kar sakte hai. Isse aap multiple tags par same style apply kar sakte hai.
Syntax:
<tagName 1 class= “my class”> other content</tagName>

<tagName 2 class= “my class”> other content</tagName>

Title

Title attribute ki madat se aap ek element ke bare me jyada se jyada information dene ke liye use kar sakte hai.
Syntax:
<tagName tilte= “Name”> Content</tagName>

Dir

Dir attribute ki madat se ander define kiye gaye content  ka direction define kar sakte hai. Iski value rtl, ltr aur auto hai.
Syntax:
tagName dir= “value”> content</tagName>

Accesskey

Accesskey attribute ki madat se aap kisi bhi tag par focus crate karne ke liye ek shortcut key define kar sakte hai.
<tagName accesskey= “”> content</tagName>

Alt

Alt attribute ki madat se ek image ke bareme alternative text likhne ke liye kar sakte hai.
Syntax:
<img alt= “text”>

Lang

Lang attribute ki madat se aap content ke language ko define kar sakte hai.
<tagName lang= “”>content </tagName>


Previous: First webpages
Next:Formatting

Post a Comment

0 Comments