使梯形我想打一個梯形填充畫面,就像這樣:從圖像
我不需要旋轉。我不需要傾斜圖片。 transform: matrix
不起作用!
解決方案几乎只找到需要的兩段代碼連接:
background-image:url("http://3.bp.blogspot.com/-D9i-wqTIjFw/T5x_51p2rJI/AAAAAAAABLs/VytuZcJGNuY/s400/indahnya.jpg");
這一良好代碼:
.myShape {
width: 0;
height: 50px;
border-left: 50px solid red;
border-top: 20px solid transparent;
border-bottom: 20px solid transparent;
}
我不認爲這是可能的2D變換;你需要'rotateY'的視角。 – Ryan
例如,http://codepen.io/minitech/pen/GbDHn。你可以對任何圖像做同樣的事情。 – Ryan
或者你是說你只是想將圖像裁剪成梯形區域? – Ryan