国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

CSS3 漸變

CSS3?漸層(Gradients)

CSS3 漸層(gradients)可以讓你在兩個(gè)或多個(gè)指定的顏色之間顯示平穩(wěn)的過(guò)渡。

以前,你必須使用圖像來(lái)實(shí)現(xiàn)這些效果。但是,透過(guò)使用 CSS3 漸層(gradients),你可以減少下載的事件和寬頻的使用。此外,漸層效果的元素在放大時(shí)看起來(lái)效果更好,因?yàn)闈u層(gradient)是由瀏覽器產(chǎn)生的。

CSS3 定義了兩種類型的漸變(gradients):

  • 線性漸變(Linear Gradients)- 向下/向上/向左/向右/對(duì)角線方向

  • 徑向漸層(Radial Gradients)- 由它們的中心定義


##CSS3 線性漸變

為了建立一個(gè)線性漸變,你必須至少定義兩個(gè)顏色結(jié)點(diǎn)。顏色結(jié)點(diǎn)即你想要呈現(xiàn)平穩(wěn)過(guò)渡的顏色。同時(shí),你也可以設(shè)定一個(gè)起點(diǎn)和一個(gè)方向(或一個(gè)角度)。

線性漸變的實(shí)例:

語(yǔ)法

#background: linear-gradient(direction, color-stop1,?color-stop2, ...);

#線性漸變- 從上到下(預(yù)設(shè))

#下面的實(shí)例示範(fàn)了從頂部開(kāi)始的線性漸變。起點(diǎn)是紅色,慢慢過(guò)渡到藍(lán)色:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>php中文網(wǎng)(php.cn)</title>
    <style>
        #grad1 {
            height: 200px;
            background: -webkit-linear-gradient(red, blue); /* Safari 5.1 - 6.0 */
            background: -o-linear-gradient(red, blue); /* Opera 11.1 - 12.0 */
            background: -moz-linear-gradient(red, blue); /* Firefox 3.6 - 15 */
            background: linear-gradient(red, blue); /* 標(biāo)準(zhǔn)的語(yǔ)法(必須放在最后) */
        }
    </style>
</head>
<body>
<h3>線性漸變 - 從上到下</h3>
<p>從頂部開(kāi)始的線性漸變。起點(diǎn)是紅色,慢慢過(guò)渡到藍(lán)色:</p>
<div id="grad1"></div>
</body>
</html>

運(yùn)行程式嘗試


線性漸變- 從左到右

下面的實(shí)例示範(fàn)了從左邊開(kāi)始的線性漸層。起點(diǎn)是紅色,慢慢過(guò)渡到藍(lán)色:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<title>php中文網(wǎng)(php.cn)</title> 
<style>
#grad1 {
    height: 200px;
    background: -webkit-linear-gradient(left, red , blue); /* Safari 5.1 - 6.0 */
    background: -o-linear-gradient(right, red, blue); /* Opera 11.1 - 12.0 */
    background: -moz-linear-gradient(right, red, blue); /* Firefox 3.6 - 15 */
    background: linear-gradient(to right, red , blue); /* 標(biāo)準(zhǔn)的語(yǔ)法(必須放在最后) */
}
</style>
</head>
<body>
<h3>線性漸變 - 從左到右</h3>
<p>從左邊開(kāi)始的線性漸變。起點(diǎn)是紅色,慢慢過(guò)渡到藍(lán)色:</p>
<div id="grad1"></div>
<p><strong>注意:</strong> Internet Explorer 9 及之前的版本不支持漸變。</p>
</body>
</html>

運(yùn)行程式嘗試


#線性漸變- 對(duì)角線

你可以透過(guò)指定水平和垂直的起始位置來(lái)製作對(duì)角線漸層。

下面的實(shí)例示範(fàn)了從左上角開(kāi)始(到右下角)的線性漸層。起點(diǎn)是紅色,慢慢過(guò)渡到藍(lán)色:

實(shí)例

從左上角到右下角的線性漸層:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<title>php中文網(wǎng)(php.cn)</title> 
<style>
#grad1 {
    height: 200px;
    background: -webkit-linear-gradient(left top, red , blue); /* Safari 5.1 - 6.0 */
    background: -o-linear-gradient(bottom right, red, blue); /* Opera 11.1 - 12.0 */
    background: -moz-linear-gradient(bottom right, red, blue); /* Firefox 3.6 - 15 */
    background: linear-gradient(to bottom right, red , blue); /* 標(biāo)準(zhǔn)的語(yǔ)法(必須放在最后) */
}
</style>
</head>
<body>
<h3>線性漸變 - 對(duì)角</h3>
<p>從左上角開(kāi)始(到右下角)的線性漸變。起點(diǎn)是紅色,慢慢過(guò)渡到藍(lán)色:</p>
<div id="grad1"></div>
<p><strong>注意:</strong> Internet Explorer 9 及之前的版本不支持漸變。</p>
</body>
</html>

執(zhí)行程式嘗試


使用角度

如果你想要在漸變的方向上做更多的控制,你可以定義一個(gè)角度,而不用預(yù)先定義方向(to bottom、to top、to right、to left、to bottom right,等等)。

語(yǔ)法

#background: linear-gradient(angle,?color-stop1,?color-stop2);

角度是指水平線和漸層線之間的角度,逆時(shí)針?lè)较蛴?jì)算。換句話說(shuō),0deg 將創(chuàng)建一個(gè)從下到上的漸變,90deg 將創(chuàng)建一個(gè)從左到右的漸變。

7B0CC41A-86DC-4E1B-8A69-A410E6764B91.jpg

但是,請(qǐng)注意很多瀏覽器(Chrome,Safari,fiefox等)的使用了舊的標(biāo)準(zhǔn),即0deg 將創(chuàng)建一個(gè)從左到右的漸變,90deg將創(chuàng)建一個(gè)從下到上的漸變。換算公式?90 - x = y?其中 x 為標(biāo)準(zhǔn)角度,y為非標(biāo)準(zhǔn)角度。

下面的實(shí)例示範(fàn)如何在線性漸變上使用角度:

#實(shí)例

帶有指定的角度的線性漸層:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<title>php中文網(wǎng)(php.cn)</title> 
<style>
#grad1 {
    height: 100px;
    background: -webkit-linear-gradient(0deg, red, blue); /* Safari 5.1 - 6.0 */
    background: -o-linear-gradient(0deg, red, blue); /* Opera 11.1 - 12.0 */
    background: -moz-linear-gradient(0deg, red, blue); /* Firefox 3.6 - 15 */
    background: linear-gradient(0deg, red, blue); /* 標(biāo)準(zhǔn)的語(yǔ)法(必須放在最后) */
}
#grad2 {
    height: 100px;
    background: -webkit-linear-gradient(90deg, red, blue); /* Safari 5.1 - 6.0 */
    background: -o-linear-gradient(90deg, red, blue); /* Opera 11.1 - 12.0 */
    background: -moz-linear-gradient(90deg, red, blue); /* Firefox 3.6 - 15 */
    background: linear-gradient(90deg, red, blue); /* 標(biāo)準(zhǔn)的語(yǔ)法(必須放在最后) */
}
#grad3 {
    height: 100px;
    background: -webkit-linear-gradient(180deg, red, blue); /* Safari 5.1 - 6.0 */
    background: -o-linear-gradient(180deg, red, blue); /* Opera 11.1 - 12.0 */
    background: -moz-linear-gradient(180deg, red, blue); /* Firefox 3.6 - 15 */
    background: linear-gradient(180deg, red, blue); /* 標(biāo)準(zhǔn)的語(yǔ)法(必須放在最后) */
}
#grad4 {
    height: 100px;
    background: -webkit-linear-gradient(-90deg, red, blue); /* Safari 5.1 - 6.0 */
    background: -o-linear-gradient(-90deg, red, blue); /* Opera 11.1 - 12.0 */
    background: -moz-linear-gradient(-90deg, red, blue); /* Firefox 3.6 - 15 */
    background: linear-gradient(-90deg, red, blue); /* 標(biāo)準(zhǔn)的語(yǔ)法(必須放在最后) */
}
</style>
</head>
<body>
<h3>線性漸變 - 使用不同的角度</h3>
<div id="grad1" style="color:white;text-align:center;">0deg</div><br>
<div id="grad2" style="color:white;text-align:center;">90deg</div><br>
<div id="grad3" style="color:white;text-align:center;">180deg</div><br>
<div id="grad4" style="color:white;text-align:center;">-90deg</div>
<p><strong>注意:</strong> Internet Explorer 9 及之前的版本不支持漸變。</p>
</body>
</html>

執(zhí)行程式試試看


#使用多個(gè)色彩結(jié)點(diǎn)

下面的實(shí)例示範(fàn)如何設(shè)定多個(gè)顏色結(jié)點(diǎn):

實(shí)例

#帶有多個(gè)顏色結(jié)點(diǎn)的從上到下的線性漸變:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<title>php中文網(wǎng)(php.cn)</title> 
<style>
#grad1 {
    height: 200px;
    background: -webkit-linear-gradient(red, green, blue); /* Safari 5.1 - 6.0 */
    background: -o-linear-gradient(red, green, blue); /* Opera 11.1 - 12.0 */
    background: -moz-linear-gradient(red, green, blue); /* Firefox 3.6 - 15 */
    background: linear-gradient(red, green, blue); /* 標(biāo)準(zhǔn)的語(yǔ)法(必須放在最后) */
}
#grad2 {
    height: 200px;
    background: -webkit-linear-gradient(red, orange, yellow, green, blue, indigo, violet); /* Safari 5.1 - 6.0 */
    background: -o-linear-gradient(red, orange, yellow, green, blue, indigo, violet); /* Opera 11.1 - 12.0 */
    background: -moz-linear-gradient(red, orange, yellow, green, blue, indigo, violet); /* Firefox 3.6 - 15 */
    background: linear-gradient(red, orange, yellow, green, blue, indigo, violet); /* 標(biāo)準(zhǔn)的語(yǔ)法(必須放在最后) */
}
#grad3 {
    height: 200px;
    background: -webkit-linear-gradient(red 10%, green 85%, blue 90%); /* Safari 5.1 - 6.0 */
    background: -o-linear-gradient(red 10%, green 85%, blue 90%); /* Opera 11.1 - 12.0 */
    background: -moz-linear-gradient(red 10%, green 85%, blue 90%); /* Firefox 3.6 - 15 */
    background: linear-gradient(red 10%, green 85%, blue 90%); /* 標(biāo)準(zhǔn)的語(yǔ)法(必須放在最后) */
}
</style>
</head>
<body>
<h3>3 個(gè)顏色結(jié)點(diǎn)(均勻分布)</h3>
<div id="grad1"></div>
<h3>7 個(gè)顏色結(jié)點(diǎn)(均勻分布)</h3>
<div id="grad2"></div>
<h3>3 個(gè)顏色結(jié)點(diǎn)(不均勻分布)</h3>
<div id="grad3"></div>
<p><strong>注意:</strong> 當(dāng)未指定百分比時(shí),顏色結(jié)點(diǎn)不會(huì)自動(dòng)均勻分布。</p>
<p><strong>注意:</strong> Internet Explorer 9 及之前的版本不支持漸變。</p>
</body>
</html>

執(zhí)行程式嘗試一下


下面的實(shí)例示範(fàn)如何建立一個(gè)帶有彩虹顏色和文字的線性漸層:

實(shí)例

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<title>php中文網(wǎng)(php.cn)</title> 
<style>
#grad1 {
    height: 55px;
    background: -webkit-linear-gradient(left, red, orange, yellow, green, blue, indigo, violet); /* Safari 5.1 - 6.0 */
    background: -o-linear-gradient(left, red, orange, yellow, green, blue, indigo, violet); /* Opera 11.1 - 12.0 */
    background: -moz-linear-gradient(left, red, orange, yellow, green, blue, indigo, violet); /* Firefox 3.6 - 15 */
    background: linear-gradient(to right, red, orange, yellow, green, blue, indigo, violet); /* 標(biāo)準(zhǔn)的語(yǔ)法(必須放在最后) */
}
</style>
</head>
<body>
<div id="grad1" style="text-align:center;margin:auto;color:#888888;font-size:40px;font-weight:bold">
漸變背景
</div>
<p><strong>注意:</strong> Internet Explorer 9 及之前的版本不支持漸變。</p>
</body>
</html>

執(zhí)行程式嘗試一下


使用透明度(Transparency)

CSS3 漸層也支持透明度(transparency),可用於建立減弱變淡的效果。

為了增加透明度,我們使用 rgba() 函數(shù)來(lái)定義顏色結(jié)點(diǎn)。 rgba() 函數(shù)中的最後一個(gè)參數(shù)可以是從 0 到 1 的值,它定義了顏色的透明度:0 表示完全透明,1 表示完全不透明。

下面的實(shí)例示範(fàn)了從左邊開(kāi)始的線性漸層。起點(diǎn)是完全透明,慢慢過(guò)渡到完全不透明的紅色:

實(shí)例

從左到右的線性漸變,帶有透明度:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<title>php中文網(wǎng)(php.cn)</title> 
<style>
#grad1 {
    height: 200px;
    background: -webkit-linear-gradient(left, rgba(255,0,0,0), rgba(255,0,0,1)); /* Safari 5.1 - 6.0 */
    background: -o-linear-gradient(right, rgba(255,0,0,0), rgba(255,0,0,1)); /* Opera 11.1 - 12.0 */
    background: -moz-linear-gradient(right, rgba(255,0,0,0), rgba(255,0,0,1)); /* Firefox 3.6 - 15 */
    background: linear-gradient(to right, rgba(255,0,0,0), rgba(255,0,0,1)); /* 標(biāo)準(zhǔn)的語(yǔ)法(必須放在最后) */
}
</style>
</head>
<body>
<h3>線性漸變 - 透明度</h3>
<p>為了添加透明度,我們使用 rgba() 函數(shù)來(lái)定義顏色結(jié)點(diǎn)。rgba() 函數(shù)中的最后一個(gè)參數(shù)可以是從 0 到 1 的值,它定義了顏色的透明度:0 表示完全透明,1 表示完全不透明。</p>
<div id="grad1"></div>
<p><strong>注意:</strong> Internet Explorer 9 及之前的版本不支持漸變。</p>
</body>
</html>

執(zhí)行程式嘗試


##重複的線性漸層

repeating-linear-gradient()函數(shù)用於重複線性漸變:

實(shí)例

#一個(gè)重複的線性漸變:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<title>php中文網(wǎng)(php.cn)</title> 
<style>
#grad1 {
    height: 200px;
    background: -webkit-repeating-linear-gradient(red, yellow 10%, green 20%); /* Safari 5.1 - 6.0 */
    background: -o-repeating-linear-gradient(red, yellow 10%, green 20%); /* Opera 11.1 - 12.0 */
    background: -moz-repeating-linear-gradient(red, yellow 10%, green 20%); /* Firefox 3.6 - 15 */
    background: repeating-linear-gradient(red, yellow 10%, green 20%); /* 標(biāo)準(zhǔn)的語(yǔ)法(必須放在最后) */
}
</style>
</head>
<body>
<h3>重復(fù)的線性漸變</h3>
<div id="grad1"></div>
<p><strong>注意:</strong> Internet Explorer 9 及之前的版本不支持漸變。</p>
</body>
</html>

執(zhí)行程式嘗試


CSS3 徑向漸層

徑向漸層由它的中心定義。

為了創(chuàng)造一個(gè)徑向漸變,你也必須至少定義兩種顏色結(jié)點(diǎn)。顏色結(jié)點(diǎn)即你想要呈現(xiàn)平穩(wěn)過(guò)渡的顏色。同時(shí),你也可以指定漸層的中心、形狀(原型或橢圓形)、大小。預(yù)設(shè)情況下,漸變的中心是 center(表示在中心點(diǎn)),漸變的形狀是 ellipse(表示橢圓形),漸變的大小是 farthest-corner(表示到最遠(yuǎn)的角落)。

徑向漸層的實(shí)例

#語(yǔ)法

background: radial-gradient(center, shape size, start-color, ..., last-color);

徑向漸層- 色彩結(jié)點(diǎn)均勻分佈(預(yù)設(shè))

實(shí)例

顏色結(jié)點(diǎn)均勻分佈的徑向漸層:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<title>php中文網(wǎng)(php.cn)</title> 
<style>
#grad1 {
    height: 150px;
    width: 200px;
    background: -webkit-radial-gradient(red, green, blue); /* Safari 5.1 - 6.0 */
    background: -o-radial-gradient(red, green, blue); /* Opera 11.6 - 12.0 */
    background: -moz-radial-gradient(red, green, blue); /* Firefox 3.6 - 15 */
    background: radial-gradient(red, green, blue); /* 標(biāo)準(zhǔn)的語(yǔ)法(必須放在最后) */
}
</style>
</head>
<body>
<h3>徑向漸變 - 顏色結(jié)點(diǎn)均勻分布</h3>
<div id="grad1"></div>
<p><strong>注意:</strong> Internet Explorer 9 及之前的版本不支持漸變。</p>
</body>
</html>

執(zhí)行程式嘗試一下


#實(shí)例

顏色結(jié)點(diǎn)不均勻分佈的徑向漸變:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<title>php中文網(wǎng)(php.cn)</title> 
<style>
#grad1 {
    height: 150px;
    width: 200px;
    background: -webkit-radial-gradient(red 5%, green 15%, blue 60%); /* Safari 5.1 - 6.0 */
    background: -o-radial-gradient(red 5%, green 15%, blue 60%); /* Opera 11.6 - 12.0 */
    background: -moz-radial-gradient(red 5%, green 15%, blue 60%); /* Firefox 3.6 - 15 */
    background: radial-gradient(red 5%, green 15%, blue 60%); /* 標(biāo)準(zhǔn)的語(yǔ)法(必須放在最后) */
}
</style>
</head>
<body>
<h3>徑向漸變 - 顏色結(jié)點(diǎn)不均勻分布</h3>
<div id="grad1"></div>
<p><strong>注意:</strong> Internet Explorer 9 及之前的版本不支持漸變。</p>
</body>
</html>

執(zhí)行程式嘗試一下


#設(shè)定形狀

shape 參數(shù)定義了形狀。它可以是值 circle 或 ellipse。其中,circle 表示圓形,ellipse 表示橢圓形。預(yù)設(shè)值是 ellipse。

實(shí)例

形狀為圓形的徑向漸層:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<title>php中文網(wǎng)(php.cn)</title> 
<style>
#grad1 {
    height: 150px;
    width: 200px;
    background: -webkit-radial-gradient(red, yellow, green); /* Safari 5.1 - 6.0 */
    background: -o-radial-gradient(red, yellow, green); /* Opera 11.6 - 12.0 */
    background: -moz-radial-gradient(red, yellow, green); /* Firefox 3.6 - 15 */
    background: radial-gradient(red, yellow, green); /* 標(biāo)準(zhǔn)的語(yǔ)法(必須放在最后) */
}
#grad2 {
    height: 150px;
    width: 200px;
    background: -webkit-radial-gradient(circle, red, yellow, green); /* Safari 5.1 - 6.0 */
    background: -o-radial-gradient(circle, red, yellow, green); /* Opera 11.6 - 12.0 */
    background: -moz-radial-gradient(circle, red, yellow, green); /* Firefox 3.6 - 15 */
    background: radial-gradient(circle, red, yellow, green); /* 標(biāo)準(zhǔn)的語(yǔ)法(必須放在最后) */
}
</style>
</head>
<body>
<h3>徑向漸變 - 形狀</h3>
<p><strong>橢圓形 Ellipse(默認(rèn)):</strong></p>
<div id="grad1"></div>
<p><strong>圓形 Circle:</strong></p>
<div id="grad2"></div>
<p><strong>注意:</strong> Internet Explorer 9 及之前的版本不支持漸變。</p>
</body>
</html>

執(zhí)行程式嘗試


#不同尺寸大小關(guān)鍵字的使用

size 參數(shù)定義了漸變的大小。它可以是以下四個(gè)值:

  • closest-side

  • #farthest-side

  • ## closest-corner

  • farthest-corner

#實(shí)例


實(shí)例

##。帶有不同尺寸大小關(guān)鍵字的徑向漸層:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<title>php中文網(wǎng)(php.cn)</title> 
<style>
#grad1 {
    height: 150px;
    width: 150px;
    background: -webkit-radial-gradient(60% 55%, closest-side,blue,green,yellow,black); /* Safari 5.1 - 6.0 */
    background: -o-radial-gradient(60% 55%, closest-side,blue,green,yellow,black); /* Opera 11.6 - 12.0 */
    background: -moz-radial-gradient(60% 55%, closest-side,blue,green,yellow,black); /* Firefox 3.6 - 15 */
    background: radial-gradient(60% 55%, closest-side,blue,green,yellow,black); /* 標(biāo)準(zhǔn)的語(yǔ)法(必須放在最后) */
}
#grad2 {
    height: 150px;
    width: 150px;
    background: -webkit-radial-gradient(60% 55%, farthest-side,blue,green,yellow,black); /* Safari 5.1 - 6.0 */
    background: -o-radial-gradient(60% 55%, farthest-side,blue,green,yellow,black); /* Opera 11.6 - 12.0 */
    background: -moz-radial-gradient(60% 55%, farthest-side,blue,green,yellow,black); /* Firefox 3.6 - 15 */
    background: radial-gradient(60% 55%, farthest-side,blue,green,yellow,black); /* 標(biāo)準(zhǔn)的語(yǔ)法(必須放在最后) */
}
#grad3 {
    height: 150px;
    width: 150px;
    background: -webkit-radial-gradient(60% 55%, closest-corner,blue,green,yellow,black); /* Safari 5.1 - 6.0 */
    background: -o-radial-gradient(60% 55%, closest-corner,blue,green,yellow,black); /* Opera 11.6 - 12.0 */
    background: -moz-radial-gradient(60% 55%, closest-corner,blue,green,yellow,black); /* Firefox 3.6 - 15 */
    background: radial-gradient(60% 55%, closest-corner,blue,green,yellow,black); /* 標(biāo)準(zhǔn)的語(yǔ)法(必須放在最后) */
}
#grad4 {
    height: 150px;
    width: 150px;
    background: -webkit-radial-gradient(60% 55%, farthest-corner,blue,green,yellow,black); /* Safari 5.1 - 6.0 */
    background: -o-radial-gradient(60% 55%, farthest-corner,blue,green,yellow,black); /* Opera 11.6 - 12.0 */
    background: -moz-radial-gradient(60% 55%, farthest-corner,blue,green,yellow,black); /* Firefox 3.6 - 15 */
    background: radial-gradient(60% 55%, farthest-corner,blue,green,yellow,black); /* 標(biāo)準(zhǔn)的語(yǔ)法(必須放在最后) */
}
</style>
</head>
<body>
<h3>徑向漸變 - 不同尺寸大小關(guān)鍵字的使用</h3>
<p><strong>closest-side:</strong></p>
<div id="grad1"></div>
<p><strong>farthest-side:</strong></p>
<div id="grad2"></div>
<p><strong>closest-corner:</strong></p>
<div id="grad3"></div>
<p><strong>farthest-corner(默認(rèn)):</strong></p>
<div id="grad4"></div>
<p><strong>注意:</strong> Internet Explorer 9 及之前的版本不支持漸變。</p>
</body>
</html>
執(zhí)行程式嘗試



################################################### ####repeating-radial-gradient() 函數(shù)用於重複徑向漸層:###
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<title>php中文網(wǎng)(php.cn)</title> 
<style>
#grad1 {
    height: 150px;
    width: 200px;
    background: -webkit-repeating-radial-gradient(red, yellow 10%, green 15%); /* Safari 5.1 - 6.0 */
    background: -o-repeating-radial-gradient(red, yellow 10%, green 15%); /* Opera 11.6 - 12.0 */
    background: -moz-repeating-radial-gradient(red, yellow 10%, green 15%); /* Firefox 3.6 - 15 */
    background: repeating-radial-gradient(red, yellow 10%, green 15%); /* 標(biāo)準(zhǔn)的語(yǔ)法(必須放在最后) */
}
</style>
</head>
<body>
<h3>重復(fù)的徑向漸變</h3>
<div id="grad1"></div>
<p><strong>注意:</strong> Internet Explorer 9 及之前的版本不支持漸變。</p>
</body>
</html>
###執(zhí)行程式嘗試#################### #
繼續(xù)學(xué)習(xí)
||
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>php中文網(wǎng)(php.cn)</title> <style> #grad1 { height: 150px; width: 200px; background: -webkit-radial-gradient(red, yellow, green); /* Safari 5.1 - 6.0 */ background: -o-radial-gradient(red, yellow, green); /* Opera 11.6 - 12.0 */ background: -moz-radial-gradient(red, yellow, green); /* Firefox 3.6 - 15 */ background: radial-gradient(red, yellow, green); /* 標(biāo)準(zhǔn)的語(yǔ)法(必須放在最后) */ } #grad2 { height: 150px; width: 200px; background: -webkit-radial-gradient(circle, red, yellow, green); /* Safari 5.1 - 6.0 */ background: -o-radial-gradient(circle, red, yellow, green); /* Opera 11.6 - 12.0 */ background: -moz-radial-gradient(circle, red, yellow, green); /* Firefox 3.6 - 15 */ background: radial-gradient(circle, red, yellow, green); /* 標(biāo)準(zhǔn)的語(yǔ)法(必須放在最后) */ } </style> </head> <body> <h3>徑向漸變 - 形狀</h3> <p><strong>橢圓形 Ellipse(默認(rèn)):</strong></p> <div id="grad1"></div> <p><strong>圓形 Circle:</strong></p> <div id="grad2"></div> <p><strong>注意:</strong> Internet Explorer 9 及之前的版本不支持漸變。</p> </body> </html>
提交重置程式碼