CSS रिपीटिंग-लीनियर-ग्रेडिएंट () फंक्शन
उदाहरण
एक दोहराई जाने वाली रैखिक ढाल:
#grad {
background-image: repeating-linear-gradient(red, yellow 10%, green 20%);
}
नीचे और अधिक "इसे स्वयं आज़माएं" उदाहरण।
परिभाषा और उपयोग
रिपीटिंग-लीनियर-ग्रेडिएंट () फ़ंक्शन का उपयोग लीनियर ग्रेडिएंट्स को दोहराने के लिए किया जाता है।
संस्करण: | CSS3 |
---|
ब्राउज़र समर्थन
तालिका में संख्याएं पहले ब्राउज़र संस्करण को निर्दिष्ट करती हैं जो फ़ंक्शन का पूर्ण समर्थन करता है।
-वेबकिट-, -मोज़-, या -ओ- के बाद नंबर एक उपसर्ग के साथ काम करने वाले पहले संस्करण को निर्दिष्ट करें।
Function | |||||
---|---|---|---|---|---|
repeating-linear-gradient() | 26.0 10.0 -webkit- |
10.0 | 16.0 3.6 -moz- |
6.1 5.1 -webkit- |
12.1 11.1 -o- |
सीएसएस सिंटेक्स
background-image: repeating-linear-gradient(angle | to side-or-corner, color-stop1,
color-stop2, ...);
Value | Description |
---|---|
angle | Defines an angle of direction for the gradient. From 0deg to 360deg. Default is 180deg. |
side-or-corner | Defines the position of the starting-point of the gradient line. It consists of two keywords: the first one indicates the horizontal side, left or right, and the second one the vertical side, top or bottom. The order is not relevant and each of the keyword is optional. |
color-stop1, color-stop2,... | 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). |
और ज्यादा उदाहरण
उदाहरण
विभिन्न दोहराए जाने वाले रैखिक ग्रेडिएंट्स:
#grad1 {
background-image: repeating-linear-gradient(45deg,
red, blue 7%, green 10%);
}
#grad2 {
background-image: repeating-linear-gradient(190deg, red, blue 7%,
green 10%);
}
#grad3 {
background-image:
repeating-linear-gradient(90deg, red, blue 7%, green 10%);
}
संबंधित पृष्ठ
सीएसएस ट्यूटोरियल: सीएसएस ग्रेडिएंट्स