下の例に示すように、背景色が緑色のボックスの上に対角線を作成したいとします。どのCSSを使ってこれを行うべきですか?CSSの背景色でボックスの上に対角線を作成します
Diagonal line on top of green background color
私はこのコードでそれを行うために管理:
.quote {
background: #41ade5;
color: #fff;
position: relative;
z-index: 1;
}
.quote:before {
background: inherit;
bottom: 0 !important;
content: '' !important;
display: block !important;
height: 50% !important;
left: 0 !important;
position: absolute !important;
right: 0 !important;
transform: skewY(1.5deg) !important;
transform-origin: 100% 0 !important;
z-index: -1 !important;
top: 0;
}`
しかし、その後、対角線は、多くのエッジ、および鋭くないを得ました。下の画像に示されている:
は、誰もがよりクリーンで対角線を作るための任意の良いCSSのヒントを持っていますか?