CSS တန်ပြန်() လုပ်ဆောင်ချက်
ဥပမာ
စာမျက်နှာအတွက် ကောင်တာတစ်ခုဖန်တီးပါ (ကိုယ်ထည်ရွေးချယ်မှုတွင်)။ <h2> ဒြပ်စင်တစ်ခုစီအတွက် တန်ပြန်တန်ဖိုးကို တိုးပြီး <h2> ဒြပ်စင်တစ်ခုစီရှေ့တွင် "အပိုင်း < တန်ပြန်၏တန်ဖိုး >:" ဟူသော စာသားကို ထည့်ပါ။
body {
counter-reset: section;
}
h2::before {
counter-increment: section;
content: "Section " counter(section) ": ";
}
အောက်တွင် နောက်ထပ် "စမ်းသုံးကြည့်ပါ" ဥပမာများ။
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
counter() လုပ်ဆောင်ချက်သည် string တစ်ခုအနေဖြင့် အမည်ပေးထားသောကောင်တာ၏ လက်ရှိတန်ဖိုးကို ပြန်ပေးသည်။
ဗားရှင်း- | CSS3 |
---|
Browser ပံ့ပိုးမှု
Function | |||||
---|---|---|---|---|---|
counter() | Yes | Yes | Yes | Yes | Yes |
CSS Syntax
counter(countername,
counterstyle)
Value | Description |
---|---|
countername | Required. The name of the counter (which is the same name used for the counter-reset and counter-increment properties) |
counterstyle | Optional. The style of the counter (can be a list-style-type value) |
နောက်ထပ် ဥပမာများ
ဥပမာ
ကောင်တာပုံစံကို သတ်မှတ်ပါ-
body {
counter-reset: section;
}
h2::before {
counter-increment: section;
content: "Section " counter(section,
upper-roman) ": ";
}
ဆက်စပ်စာမျက်နှာများ
CSS ရည်ညွှန်းချက်- အကြောင်းအရာ ပိုင်ဆိုင်မှု
CSS ရည်ညွှန်းချက်- တန်ပြန်-တိုးမြှင့်မှု ပိုင်ဆိုင်မှု
CSS ရည်ညွှန်းချက်- တန်ပြန်ပြန်လည်သတ်မှတ်မှု ပိုင်ဆိုင်မှု