HTML Attributes in Hindi
HTML Attributes क्या होते हैं?
HTML Attributes वो extra information होती है जो किसी tag में दी जाती है। ये browser को बताते हैं कि element का behavior या appearance कैसा होना चाहिए। Attributes हमेशा opening tag में ही लिखे जाते हैं।
Attribute की Structure
Attribute tag के अंदर लिखा जाता है और इसका format ऐसा होता है:
<tagname attribute="value">Content</tagname>
यहां attribute उसका नाम होता है और value उसका मान।
href Attribute
<a> tag में सबसे important attribute href होता है। यह बताता है कि link किस URL पर जाएगा। Example:
src Attribute
<img> tag में src attribute होता है। इससे browser को पता चलता है कि image कहां से लानी है। Example:
alt Attribute
<img> tag में ही alt attribute लिखा जाता है। यह image का alternative text होता है जो image load न होने पर दिखता है या visually impaired users को पढ़कर सुनाया जाता है।
style Attribute
style attribute किसी भी tag में inline CSS लगाने के लिए use होता है। इससे direct element का color, size या design बदला जा सकता है। Example:
id Attribute
id attribute element को एक unique identity देता है। इससे CSS या JavaScript में उसे अलग से select किया जा सकता है। Example:
class Attribute
class attribute कई elements को एक ही group में रखने के लिए use होता है। यह styling और scripting में helpful होता है। Example:
HTML Attributes elements में extra details जोड़ने का तरीका हैं। यह बताते हैं कि element कैसे behave करेगा और कैसा दिखेगा। Attributes के बिना HTML tags अधूरे माने जाते हैं।
Request
Leave a Comment
INITIALIZING...
INITIALIZING...
Comments Total: 0 comments