HTML <a> Tag
ဥပမာ
W3Schools.com သို့ လင့်ခ်တစ်ခု ဖန်တီးပါ။
<a href="https://www.w3schools.com">Visit W3Schools.com!</a>
အောက်တွင် နောက်ထပ် "စမ်းသုံးကြည့်ပါ" ဥပမာများ။
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
<a>
tag သည် စာမျက်နှာတစ်ခုမှ နောက်တစ်ခုသို့ လင့်ခ်ချိတ်ရန် အသုံးပြုသည့် ဟိုက်ပါလင့်ခ်တစ်ခုကို သတ်မှတ်သည် ။
<a>
ဒြပ်စင် ၏ အရေးအကြီးဆုံး အရည်အချင်းမှာ
href
လင့်ခ်၏ ဦးတည်ရာကို ညွှန်ပြသည့် အရည်အချင်းဖြစ်သည်။
မူရင်းအားဖြင့်၊ ဘရောက်ဆာအားလုံးတွင် အောက်ပါအတိုင်း လင့်ခ်များ ပေါ်လာလိမ့်မည်-
- မကြည့်ရသေးသောလင့်ခ်သည် မျဉ်းသားပြီး အပြာရောင်ရှိသည်။
- ဝင်ကြည့်ထားသောလင့်ခ်သည် မျဉ်းသားပြီး ခရမ်းရောင်ဖြစ်သည်။
- အသက်ဝင်သောလင့်ခ်ကို မျဉ်းသားပြီး အနီရောင်ရှိသည်။
အကြံပြုချက်များနှင့် မှတ်စုများ
အကြံပြုချက်-<a>
တဂ်တွင် ရည်ညွှန်းချက်မရှိပါက ၊
href
၎င်းသည် ဟိုက်ပါလင့်ခ်အတွက် နေရာတစ်ခုသာဖြစ်သည်။
အကြံပြုချက်- အခြားပစ်မှတ်ကို သင်သတ်မှတ်မထားပါက လက်ရှိဘရောက်ဆာဝင်းဒိုးတွင် လင့်ခ်ချိတ်ထားသော စာမျက်နှာကို ပုံမှန်အားဖြင့် ပြသပါသည်။
အကြံပြုချက်- လင့်ခ်များကို ပုံစံဖော်ရန် CSS ကိုသုံးပါ- CSS လင့်ခ် များနှင့် CSS ခလုတ် များ ။
Browser ပံ့ပိုးမှု
Element | |||||
---|---|---|---|---|---|
<a> | Yes | Yes | Yes | Yes | Yes |
ဂုဏ်တော်
Attribute | Value | Description |
---|---|---|
download | filename | Specifies that the target will be downloaded when a user clicks on the hyperlink |
href | URL | Specifies the URL of the page the link goes to |
hreflang | language_code | Specifies the language of the linked document |
media | media_query | Specifies what media/device the linked document is optimized for |
ping | list_of_URLs | Specifies a space-separated list of URLs to which, when the link is followed, post requests with the body ping will be sent by the browser (in the background). Typically used for tracking. |
referrerpolicy | no-referrer no-referrer-when-downgrade origin origin-when-cross-origin same-origin strict-origin-when-cross-origin unsafe-url |
Specifies which referrer information to send with the link |
rel | alternate author bookmark external help license next nofollow noreferrer noopener prev search tag |
Specifies the relationship between the current document and the linked document |
target | _blank _parent _self _top |
Specifies where to open the linked document |
type | media_type | Specifies the media type of the linked document |
ကမ္ဘာလုံးဆိုင်ရာ အရည်အချင်းများ
<a>
tag သည် HTML တွင် Global Attributes ကို ပံ့ပိုး ပေးပါသည်။
ဖြစ်ရပ်ဂုဏ်တော်များ
<a>
tag သည် HTML ရှိ Event Attributes များကိုလည်း ပံ့ပိုး ပေးပါသည် ။
နောက်ထပ် ဥပမာများ
ဥပမာ
ပုံတစ်ပုံကို လင့်ခ်တစ်ခုအဖြစ် အသုံးပြုနည်း
<a href="https://www.w3schools.com">
<img border="0" alt="W3Schools"
src="logo_w3s.gif" width="100" height="100">
</a>
ဥပမာ
ဘရောက်ဆာဝင်းဒိုးအသစ်တွင် လင့်ခ်တစ်ခုဖွင့်နည်း-
<a href="https://www.w3schools.com" target="_blank">Visit W3Schools.com!</a>
ဥပမာ
ဖုန်းနံပါတ်သို့ လင့်ခ်ချိတ်နည်း
<a href="tel:+4733378901">+47 333 78 901</a>
ဥပမာ
တူညီသောစာမျက်နှာရှိ အခြားကဏ္ဍသို့ လင့်ခ်ချိတ်နည်း-
<a href="#section2">Go to Section 2</a>
ဥပမာ
JavaScript သို့ လင့်ခ်လုပ်နည်း
<a href="javascript:alert('Hello World!');">Execute JavaScript</a>
ဆက်စပ်စာမျက်နှာများ
HTML သင်ခန်းစာ- HTML လင့်ခ် များ
HTML DOM ရည်ညွှန်း- Anchor Object
CSS ကျူတိုရီရယ်- ပုံစံလင့်ခ် များ
မူရင်း CSS ဆက်တင်များ
ဘရောက်ဆာအများစုသည် <a>
အောက်ဖော်ပြပါ ပုံသေတန်ဖိုးများဖြင့် အစိတ်အပိုင်းကို ပြသလိမ့်မည်-
a:link, a:visited {
color: (internal value);
text-decoration: underline;
cursor: auto;
}
a:link:active, a:visited:active {
color: (internal value);
}