<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>transform導航</title>
<style>
ul{
margin:0;
padding:0;
list-style:none;
}
li{
float:left;
width:100px;
text-align: center;
height:30px;
border:solid 1px #fff;
background:red;
font:12px/30px "宋體";
-Webkit-transform:skewX(-30deg);
}
a{
text-decoration: none;
-Webkit-transform:skewX(30deg);
display:block;
}
</style>
</head>
<body>
<ul>
<li><a href="#">個人首頁</a></li>
<li><a href="#">交流社區</a></li>
</ul>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>transform小問題</title>
<style>
body{
height:400px;
border:solid 1px #000;
}
.box{
height:100px;
width:100px;
background:red;
margin: 10px;
transition:2s;
font:50px/100px "宋體";
color:#fff;
text-align:center;
}
body:hover .box:nth-of-type(1){
-Webkit-transform:translate(100px) scale(0.5);/*縮放先於位移執行*/
}
body:hover .box:nth-of-type(2){
-Webkit-transform:scale(0.5) translate(100px) ;/*位移先於縮放執行*/
}
</style>
</head>
<body>
<div class="box">
哈
</div>
<div class="box">
嘿
</div>
</body>
</html>
網頁顯示截圖:執行後: