CSS : ပစ်မှတ် ရွေးချယ်သူ
ဥပမာ
အသက်ဝင်သော HTML မျိုးရိုးကို အသားပေးဖော်ပြသည်-
:target
{
border: 2px solid #D4D4D4;
background-color: #e5eecc;
}
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
မှတ်တမ်းတစ်ခုအတွင်းရှိ အချို့သောဒြပ်စင်တစ်ခုထံသို့ ကျောက်ဆူးအမည်ဖြင့် နောက်တွင် # တစ်ခုပါသော URL များ။ ချိတ်ဆက်ထားသည့်ဒြပ်စင်သည် ပစ်မှတ်ဒြပ်စင်ဖြစ်သည်။
လက်ရှိ :target
အသုံးပြုနေသည့် ပစ်မှတ်ဒြပ်စင်ကို ပုံစံသတ်မှတ်ရန် ရွေးချယ်ကိရိယာကို အသုံးပြုနိုင်သည်။
ဗားရှင်း- | CSS3 |
---|
Browser ပံ့ပိုးမှု
ဇယားရှိ နံပါတ်များသည် ရွေးချယ်သူကို အပြည့်အဝထောက်ခံသည့် ပထမဆုံးဘရောက်ဆာဗားရှင်းကို သတ်မှတ်ပေးပါသည်။
Selector | |||||
---|---|---|---|---|---|
:target | 4.0 | 9.0 | 3.5 | 3.2 | 9.6 |
CSS Syntax
:target {
css declarations;
}
နောက်ထပ် ဥပမာများ
ဥပမာ
တက်ဘ်လုပ်ထားသော မီနူးကို ဖန်တီးပါ-
.tab div {
display: none;
}
.tab div:target {
display: block;
}
ဥပမာ
modal (dialog box) ဖန်တီးပါ-
/* The modal's background */
.modal {
display: none;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
background-color: rgb(0, 0, 0);
background-color: rgba(0, 0, 0, 0.4);
}
/* Display the modal when targeted */
.modal:target {
display: table;
position: absolute;
}
/* The modal box */
.modal-dialog {
display: table-cell;
vertical-align: middle;
}
/* The modal's content */
.modal-dialog .modal-content {
margin: auto;
background-color: #f3f3f3;
position: relative;
padding: 0;
outline: 0;
border: 1px #777 solid;
text-align: justify;
width: 80%;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}