CSS အကြောင်းအရာ ပိုင်ဆိုင်မှု
ဥပမာ
အောက်ပါဥပမာသည် <a> ဒြပ်စင်တစ်ခုစီပြီးနောက် ကွင်းစဥ်တွင် href attribute ၏တန်ဖိုးကို ထည့်သွင်းသည်-
a::after {
content: " (" attr(href) ")";
}
အောက်တွင် နောက်ထပ် "စမ်းသုံးကြည့်ပါ" ဥပမာများ။
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
ထုတ်လုပ်ထားသော အကြောင်းအရာကို ထည့်သွင်းရန် ::before နှင့် ::aftercontent
pseudo-elements တို့ဖြင့် အသုံးပြု
ထားသည်။
မူလတန်ဖိုး: | ပုံမှန် |
---|---|
အမွေဆက်ခံသည်- | မဟုတ်ဘူး |
သက်ဝင်လှုပ်ရှားနိုင်သော | မဟုတ်ဘူး ကာတွန်း အကြောင်းဖတ်ပါ။ |
ဗားရှင်း- | CSS2 |
JavaScript syntax- | JavaScript ကိုအသုံးပြုခြင်းဖြင့် အစိတ်အပိုင်းတစ်ခုအား pseudo-class မပေးနိုင်သော်လည်း တူညီသောရလဒ်ကိုရရန် အခြားနည်းလမ်းများရှိပါသည်။ |
Browser ပံ့ပိုးမှု
ဇယားရှိ နံပါတ်များသည် ပိုင်ဆိုင်မှုကို အပြည့်အဝထောက်ခံသည့် ပထမဆုံးဘရောက်ဆာဗားရှင်းကို သတ်မှတ်ပေးသည်။
Property | |||||
---|---|---|---|---|---|
content | 1.0 | 8.0 | 1.0 | 1.0 | 4.0 |
CSS Syntax
content: normal|none|counter|attr|string|open-quote|close-quote|no-open-quote|no-close-quote|url|initial|inherit;
အိမ်ခြံမြေတန်ဖိုးများ
Value | Description | Example |
---|---|---|
normal | Default value. Sets the content, if specified, to normal, which default is "none" (which is nothing) | |
none | Sets the content, if specified, to nothing | |
counter | Sets the content as a counter | |
attr(attribute) | Sets the content as one of the selector's attribute | |
string | Sets the content to the text you specify | |
open-quote | Sets the content to be an opening quote | |
close-quote | Sets the content to be a closing quote | |
no-open-quote | Removes the opening quote from the content, if specified | |
no-close-quote | Removes the closing quote from the content, if specified | |
url(url) | Sets the content to be some kind of media (an image, a sound, a video, etc.) | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
နောက်ထပ် ဥပမာများ
ဥပမာ
၎င်းတို့၏မူလ ကျည်ဆန်များကို ဖယ်ရှားပြီး ကျည်ဆံများ (•) နှင့်တူသော HTML အကြောင်းအရာတစ်ခုကို ပေါင်းထည့်ခြင်းဖြင့် <ul> သို့မဟုတ် <ol> အတွက် ကျည်ဆံအရောင်များကို မည်သို့ထည့်ရမည်နည်း။
ul {
list-style: none; /* Remove HTML bullets */
padding: 0;
margin: 0;
}
li {
padding-left: 16px;
}
li::before {
content: "•"; /* Insert content that looks like bullets */
padding-right: 8px;
color: blue; /* Or a color you prefer */
}
ဆက်စပ်စာမျက်နှာများ
CSS ရည်ညွှန်းချက်- ::pseudo ဒြပ်စင် မတိုင်မီ
CSS ရည်ညွှန်းချက်- ::ပြီးနောက် pseudo ဒြပ်စင်