दोस्तों इस chapter में हम HTML Horizontal Line के बारे में जानेंगे तो चलिए शुरू करते है, HTML में horizontal लाइन का उपयोग एक लाइन खींचने के लिए किया जाता है. इस को <hr /> tag से डिफाइन किया जाता है इसका उपयोग basically text को image से separate करने के लिए किया जाता है और इसका कोई closing tag नहीं होता है, इसे HTML में horizontal rule भी कहा जाता है।
HTML horizontal लाइन का use HTML page को different horizontally classes में divided करने के लिए भी किया जाता है। Horizontal Lines की requirement हम को तब ज्यादा होती है, जब हमें एक समान तरीके से उसी प्रकार के HTML page में different प्रकार की सामग्री प्रदर्शित करनी होती है।
दोस्तों आइये अब हम <hr> tag का general syntax देखते हैं।
<hr>
दोस्तों ऊपर दिए गए syntax में आप देख सकते है <hr> tag का कोई closing tag नहीं है, इसको एक empty tag कहा जाता है, but यदि आप इसका use XHTML में कर रहे है तो इसे <hr /> tag दुवारा आपको इसे close करना होता है।
यहां पर हम आपको कुछ example create करके दिखा रहे है इनकी सहायता से आप HTML में एक horizontal line बना सकते हैं −
<!DOCTYPE html> <html> <head> <title>HTML Horizontal Line paragraph Example</title> </head> <body> <p>HTML Horizontal Line paragraph Example. <hr /> This is the Horizontal Line paragraph.</p> </body> </html>
HTML Horizontal Line paragraph Example.
<!DOCTYPE html> <html> <body> <h1>My Heading 1</h1> <p>Hello My Friend</p> <hr> <h2>My Heading 2</h2> <p>Hello My Friend</p> <hr> <h3>My Heading 3</h3> <p>Hello My Friend</p> </body> </html>
Hello My Friend
Hello My Friend
Hello My Friend