css3中的skew(skewX,skewY)用法

这是html代码

<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>index</title>
	<link href="index.css" rel="stylesheet" type="text/css">
</head>
<body>
	<div>
		<p>这是一段文字。</p>
	</div>
	<div >
		<p>这是一段文字。</p>
	</div>
</body>
</html>

这是css代码

div{
	background-color: green;
	width:150px;
	height:150px;
}
div p{
	text-align: center;
	line-height: 150px;
	color:white;
}
#div2:hover{
	transform: skew(0deg,30deg);
}

skewY是相对于Y轴的倾斜,Y轴在这里是指水平方向
示例:
skew(0deg,30deg),图形在Y方向长度不变,X方向的长度变为tan(30)*length(Y),中心点位置不变。

相关文章:

  • 2022-02-08
  • 2022-12-23
  • 2021-06-26
  • 2022-12-23
  • 2022-12-23
  • 2021-07-22
  • 2022-12-23
  • 2021-08-07
猜你喜欢
  • 2021-09-16
  • 2021-06-15
  • 2021-11-25
  • 2021-12-21
  • 2021-05-11
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案