右から左に向かう下のグラデーションを実行しようとしています。私はこれを機能させていますが、私には意味がなく、小さな変更で奇妙なことが起こります。
右から左へ右勾配を与える
-webkit-border-image: -webkit-gradient( linear, 100% 100%, 0 0, from( #000000 ), to( #ffffff) ) 0 0 100% 0;
border-bottom-width: 5px;
これにより、DIV の背景にグラデーションが配置されます。
-webkit-border-image: -webkit-gradient( linear, 100% 100%, 0 0, from( #000000 ), to( #ffffff) ) 0 0 0 0;
border-bottom-width: 5px;
私が理解していることと理解していないことは次のとおりです。
specから、それはピースを言います:
-webkit-border-image: <function> <top> <right> <bottom> <left>
これを意味します:
<top> The distance from the top edge of the image.
<right> The distance from the right edge of the image.
<bottom> The distance from the bottom edge of the image.
<left>  The distance from the left edge of the image.
つまり、私の最初のもの0 0 100% 0は、下から 100%離れた境界イメージ (つまり、グラデーション) を持つ必要があります! しかし、それは逆です。代わりに、下の境界線のグラデーションを示すのはこれだけなので、実際には下から 0 離れています。
そして、0これらすべての値を設定すると、グラデーションが div の背景になるのはなぜですか? 実際、div に がある場合background-color、ボーダー画像の上、右、下、左をすべて 0 に設定すると、背景色の上にボーダーグラデーションが描画されます。
これはどのように機能しますか?
実際の例 (異なる値に変更できます)
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title>Abbott RealTime</title>
        <style>
            .test
            {
                position: relative;
                top: 0px;
                left: 0px;
                width: 300px;
                height: 200px;
                margin:0;
                padding:0;
                border:0;
                outline:0;
                font-size:100%;
                vertical-align:baseline;
                background:transparent;
                background-color: #ffcc33;
                /* This shows the bottom border properly */
                -webkit-border-image: -webkit-gradient( linear, 100% 100%, 0 0, from( #000000 ), to( #ffffff) ) 0 0 100% 0;
                /* This one would show the gradient in the background and the border as the background color! */
                /*-webkit-border-image: -webkit-gradient( linear, 100% 100%, 0 0, from( #000000 ), to( #ffffff) ) 0 0 100% 0;*/
                border-bottom-width: 5px;
            }
        </style>
    </head>
    <body>
        <div class="test">test</div
    </body>
</html>