Dambudziko guru rine hukama nebhatani HTML href nderekuti zvinogona kunetsa kutayera bhatani nenzira inotaridzika inowirirana pamabhurawuza akasiyana. Pamusoro pezvo, kana uchishandisa anchor tag ine href hunhu, chinongedzo chinovhura pahwindo rimwe chete nekusarudzika, izvo zvingave zvisingadiwe kune mamwe marudzi emalink. Chekupedzisira, kana humbowo hwe href husina kurongeka zvakanaka, kubaya bhatani kunogona kukonzera kukanganisa peji.
<button><a href="">Click Here</a></button>
1. Uyu mutsetse wekodhi unogadzira chinhu chebhatani muHTML.
2. Mukati mebhatani element, mune anchor tag ine isina munhu href hunhu.
3. The anchor tag ine chinyorwa "Click Here".
Tsanangudzo yeHREF
HREF inomirira Hypertext Reference uye hunhu hweHTML hunoshandiswa kutsanangura hyperlink. Inoshandiswa kubatanidza peji kune imwe, ingave pane imwechete webhusaiti kana imwe webhusaiti. HREF hunhu hunotsanangura kwainoenda chinongedzo uye hunogona kushandiswa nezvimwe zvinhu zveHTML senge. , , uye
Ndinogona kushandisa HREF mubhatani HTML
Kwete, hazvigoneke kushandisa href hunhu mune bhatani chinhu muHTML. The button element haitsigire href hunhu. Nekudaro, unogona kushandisa JavaScript kuwedzera yekudzvanya chiitiko muteereri kune bhatani rinozoendesa mushandisi kune rimwe peji kana wadzvanya.
Unoisa sei href sebhatani
Kugadzira tag yeanchor sebhatani muHTML, unogona kushandisa inotevera kodhi:
Wobva wawedzera inotevera CSS kune yako stylesheet:
.bhatani {
kumashure-ruvara: #4CAF50; /* Girinhi */
muganhu: hapana;
ruvara: chena;
padding: 15px 32px;
zvinyorwa-zvinongedzera: pakati;
chinyorwa-chishongedzo: hapana;
kuratidza: inline-block; saizi yefonti: 16px; kumucheto: 4px 2px; chitubu: chinongedzo;}