HTML NOTES
4. HTML Attribute की पूरी जानकारी हिंदी में
HTML Attribute
Hello Friends!
मै विनय Concept Computer Education से.........
Introduction
Attributes किसी भी tag की कुछ special properties होती है जिसका उपयोग करके tag में कुछ additional information add कर सकते है।
HTML में जितने भी tag होते है। सभी tags में attributes define किये जाते है।
Attributes के help से tag के अंदर के सारे content को अपने अनुसार configure कर सकते है।
उदाहरण के लिए यदि आप default page background नहीं चाहते है तो उसको अपने according change कर सकते है।
Syntax of HTML Attributes
<tag name="value">my page</tag>
जैसा कि ऊपर दिए गए syntax में आप देख सकते है कि attribute को हमेशा starting tag में
define किया जाता है।
Example of HTML Attributes
Attributes का use करना बहुत ही आसान है बस आपको पता होना चाहिए कि कौन सा attribute
किस जगह use करना है।
तो चलिए attribute का use किस तरह से करते है इसे एक example के द्वारा समझने का प्रयास
करते है।
<html>
<head>
<title>my first page </title>
</head>
<body bgcolor = "red ">
<h1 style = "color:white ">heading</h1>
</body>
<html>
ऊपर दिए हुए example में 2 जगह attribute का use किया गया है।
सबसे पहले body tag में bgcolor attribute का use करके page का background color
define किया गया है।
जब आप background color define नहीं करते हो तो page का background color, by
default white color होता है।
मैंने दूसरा attribute heading tag में use किया है। यह attribute, style attribute कहलाती है।
heading tag में style attribute के द्वारा heading का color change किया गया है।
ऊपर दिए गए example का output आप यहाँ देख सकते है।
हमें attribute का use कैसे करना चाहिए ?
1. हमेशा attribute को lower case में define करना चाहिए।
2. हमेशा attribute की value को quotation mark (" " ) में define करना चाहिए।
Enjoy Our Software Engineering Notes in Hindi
Student Helpline:9650597419
Post a Comment
0 Comments