CSS radial-gradient() လုပ်ဆောင်ချက်
ဥပမာ
အညီအမျှ ကွာဟထားသော အရောင်ရပ်တန့်မှုများ အချင်းများသော အရောင်အသွေး
#grad {
background-image: radial-gradient(red, green, blue);
}
အောက်တွင် နောက်ထပ် "စမ်းသုံးကြည့်ပါ" ဥပမာများ။
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
radial-gradient() function သည် radial gradient ကို နောက်ခံပုံအဖြစ် သတ်မှတ်သည်။
radial gradient ကို ၎င်း၏ဗဟိုက သတ်မှတ်သည်။
အ၀ါရောင် gradient ဖန်တီးရန်အတွက် အနည်းဆုံး အရောင်မှတ်တိုင်နှစ်ခုကို သတ်မှတ်ရပါမည်။
Radial Gradient ဥပမာ-
ဗားရှင်း- | CSS3 |
---|
Browser ပံ့ပိုးမှု
ဇယားရှိ နံပါတ်များသည် လုပ်ဆောင်ချက်ကို အပြည့်အဝထောက်ခံသည့် ပထမဆုံးဘရောက်ဆာဗားရှင်းကို သတ်မှတ်ပေးသည်။
-webkit-၊ -moz- သို့မဟုတ် -o- ဖြင့်လိုက်သောနံပါတ်များသည် ရှေ့ဆက်တွဲတစ်ခုနှင့်အလုပ်လုပ်သော ပထမဆုံးဗားရှင်းကို သတ်မှတ်ပေးသည်။
Function | |||||
---|---|---|---|---|---|
radial-gradient() | 26.0 10.0 -webkit- |
10.0 | 16.0 3.6 -moz- |
6.1 5.1 -webkit- |
12.1 11.6 -o- |
CSS Syntax
background-image: radial-gradient(shape size at position, start-color, ..., last-color);
Value | Description |
---|---|
shape | Defines the shape of the gradient. Possible values:
|
size | Defines the size of the gradient. Possible values:
|
position | Defines the position of the gradient. Default is "center" |
start-color, ..., last-color | Color stops are the colors you want to render smooth transitions among. This value consists of a color value, followed by an optional stop position (a percentage between 0% and 100% or a length along the gradient axis). |
နောက်ထပ် ဥပမာများ
ဥပမာ
ခြားနားစွာ ခြားနားသော အရောင် ရပ်တန့်ထားသော အချင်းများသော အရောင်အသွေး
#grad {
background-image: radial-gradient(red 5%, green 15%, blue 60%);
}
ဥပမာ
စက်ဝိုင်းပုံသဏ္ဍာန်နှင့် အစွန်းအထင်းရောင်ခြယ်မှု
#grad {
background-image: radial-gradient(circle, red, yellow, green);
}
ဥပမာ
အရွယ်အစားအမျိုးမျိုးသောသော့ချက်စာလုံးများပါသည့် အစွန်းအထင်းရောင်ခြယ်မှုတစ်ခု-
#grad1 {
background-image: radial-gradient(closest-side at 60% 55%, blue, green, yellow, black);
}
#grad2 {
background-image: radial-gradient(farthest-side at 60% 55%, blue, green, yellow, black);
}
ဆက်စပ်စာမျက်နှာများ
CSS သင်ခန်းစာ- CSS Gradients