transformプロパティのskewX()、skewY()、skew()は、要素を傾斜変形させる際に使用します。
p.sample1, p.sample2, p.sample3 {background-color:limegreen;}
p.sample1 img {transform: skewX(20deg);}
p.sample2 img {transform: skewY(20deg);}
p.sample3 img {transform: skew(-20deg,-20deg);}
<html>
<head>
<link rel=”stylesheet” href=”sample.css”
type=”text/css”>
</head>
<body>
<p class=”sample1″>
skewX(20deg)<br>
<img src=”https://www.htmq.com/wp-content/uploads/2024/07/kaeru.gif”>
</p>
<p class=”sample2″>
skewY(20deg)<br>
<img src=”https://www.htmq.com/wp-content/uploads/2024/07/kaeru.gif”>
</p>
<p class=”sample3″>
skew(-20deg,-20deg)<br>
<img src=”https://www.htmq.com/wp-content/uploads/2024/07/kaeru.gif”>
</p>
</body>
</html>
skewX(20deg)
skewY(20deg)
skew(-20deg,-20deg)
p.prefix_sample1, p.prefix_sample2, p.prefix_sample3 {background-color:limegreen;}
p.prefix_sample1 img {
-moz-transform: skewX(20deg);
-webkit-transform: skewX(20deg);
-o-transform: skewX(20deg);
-ms-transform: skewX(20deg);
}
p.prefix_sample2 img {
-moz-transform: skewY(20deg);
-webkit-transform: skewY(20deg);
-o-transform: skewY(20deg);
-ms-transform: skewY(20deg);
}
p.prefix_sample3 img {
-moz-transform: skew(-20deg,-20deg);
-webkit-transform: skew(-20deg,-20deg);
-o-transform: skew(-20deg,-20deg);
-ms-transform: skew(-20deg,-20deg);
}
<html>
<head>
<link rel=”stylesheet” href=”sample.css” type=”text/css”>
</head>
<body>
<p class=”prefix_sample1″>
skewX(20deg)<br>
<img src=”https://www.htmq.com/wp-content/uploads/2024/07/kaeru.gif”>
</p>
<p class=”prefix_sample2″>
skewY(20deg)<br>
<img src=”https://www.htmq.com/wp-content/uploads/2024/07/kaeru.gif”>
</p>
<p class=”prefix_sample3″>
skew(-20deg,-20deg)<br>
<img src=”https://www.htmq.com/wp-content/uploads/2024/07/kaeru.gif”>
</p>
</body>
</html>
skewX(20deg)
skewY(20deg)
skew(-20deg,-20deg)