데모 :http://jsfiddle.net/techsin/g2x99/
업데이트 (수직) :http://jsfiddle.net/techsin/g2x99/4/
http://jsfiddle.net/techsin/g2x99/2/
이미지 here..or SVG를 사용하는 것이 훨씬 더 쉬웠을 것 또는 여기에 캔버스.
또 다른 단점은 모서리의 배경이 투명하지 않다는 것입니다.
body {background-color: #eee;}
.box {
width: 100px;
height: 40px;
background-color: rgb(115, 115, 202);
position: relative;
background-image: -webkit-gradient(
linear,
left top,
right top,
color-stop(0, rgba(255, 255, 255,.2)),
color-stop(1, rgba(0, 0, 0,.6))
);
}
.box:before,
.box:after {
font-size: 0px;
content: ".";
position: absolute;
right: 0;
}
.box:before {
border-top: 20px solid transparent;
border-right: 15px solid #eee;
bottom: 0;
}
.box:after {
border-top: 20px solid #eee;
border-left: 15px solid transparent;
top: 0;
}
여러분의 노력에 감사드립니다. 정말 수직 그라디언트가되어야합니다. 실제로 SVG로 해봤지만 궁극적으로는 할 수 있습니다. CSS를 먼저 탐구하고 싶었습니다. 어떤 아이디어를 어떻게 그라디언트로 위에서부터 아래로 갈 수 있을까요? – Britton
@Britton 그라디언트를 수직으로 변경하는 것은 그리 어렵지 않습니다. http://jsfiddle.net/g2x99/3/ –
지금 확인하세요. –