Anchor <a> element के बारे में|
हेलो दोस्तों इस पोस्ट में हम HTML के <a> element के बारे में जानेगे| और हमारे webpages में links कैसे create किये जाते है और webpages को एकदूसरे के साथ connect करने के लिए webpage की link कैसे सेट कर सकते है|
HTML <a> element और (anchor element) हमारे webpages को एकदूसरे के साथ connecting करने के लिए उपयोग होता है|<a>element अपने href attribute के साथ webpage, files, email address, और दूसरी website की url जैसी कई link href attribute के मदद से hyperlink create कर सकते है|
HTML <a>element syntax
<a href="url"> set link text here </a>
<a>element के <a>opening tag और </a>closing tag होते है|
और Links (hyperlink) का जो text होता है वह इन दो tag के बीच में ही लिखा जाता है|
Example
<a href="indexs.php"> indexs webpage link here </a>
<a>element में href attribute important होता है क्योकि वह attribute <a> element में दूसरे pages की Links indicate करता है.
HTML <a> element Hyperlink
अगर आप किसी webpage की link create करते है और उसे create की हुवी link पे click करते है तो वह हम उस पेज पे redirect कर देता है.
हम <a>element का उपयोग करके कहा पे link सेट करते है ?? <a>element उपयोग से links को हम किसी images ,<h1>to </h6> heading , text जैसे element में links सेट कर सकते है|
जब बी हम सेट की हुवी links पे अपना mouse over करते है तब वह mouse arrow hand arrow में सेट हो जाता है.
code example
<!DOCTYPE html> <html lang="en"> <head> <title>For html document set link</title> </head> <body> <ul> <li><a href="https://testtesting.com">Test website</a></li> <li><a href="mailto:test@testtesting.com">Send Email</a></li> <li><a href="tel:+123456789">Call</a></li> </ul> </body> </html>
output
By Default set Link color
Unvisited Link का color by default blue होता है.
Visited Link का color green होता है.
Active Link का color red होता है.
Link पे सेट वह by default Link का color को overrite कर सकते है css style property के उपयोग छे.
Setting the target attribute for Links
Target attribute browser में webpages (document) को कहा open करवाना है वह सेट करता है.
Four type के target defined किया जाते है जिसमे हर एक target का नाम underscore ( _ ) character के साथ में लिखा जाता है.
target attribute का _blank value webpage को browser के new tab में open करता है| और target attribute का _self , _parent , _top values webpage को browser के same tab में ही open करता है|