画像と CSS 疑似要素を使用して、ボックス シャドウとグラデーション ボーダーを追加しようとしています。
私はそのコードを試しました:
.box:before {
content: url('box-shadow.png');
position: absolute;
width: auto;
height: auto;
max-width: 100%;
z-index: -1;
bottom: -9px;
line-height: 0;
}
.box:after {
content: url('box-border.png');
position: absolute;
width: auto;
height: auto;
max-width: 100%;
bottom: -5px;
right: 0px;
}
ただし、親 div のサイズが変更されても、追加された画像のサイズは変更されませんが、画像を手動で追加することで機能します。
そのフィドルを参照してくださいhttp://jsfiddle.net/5TG3E/2/