css高级样式
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<style type="text/css">
.box1{
width:200px;
height:200px;
background-color:pink;
transition:all 3s linear;
}
.box1:hover{
/*transform:转换*/
/*translaex(X):水平方向位移*/
/*translaey(y):垂直方向位移*/
/*teanslae(x,y):水平方向位移X,垂直方向位移Y*/
transform:translate(100px,200px);
}
</style>
</head>
<body>
<div class="box1"></div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>css高级样式</title>
<style>
.box{
width:200px;
height:200px;
background-color:red;
/*transition:过渡*/
/*transition:过渡属性 过渡花费的时间*/
transition:background-color 6s;
}
/*鼠标悬停伪类*/
.box:hover{
background-color:aqua;
}
.box1{
width:200px;
height:200px;
background-color:royalblue;
/*transition:width 5s,background-color 5s;*/
/*all:全部、所有的*/
transition:all 5s linear 3s;
/*速度:ease 慢-快-慢,默认值*/
/*linear:匀速*/
/*ease-in:低速开始*/
/*ease-out:低速结束*/
/*ease-in-out:低速开始和结束*/
}
.box1:hover{
width:800px;
background-color:salmon;
}
</style>
</head>
<body>
<div class="box"></div>
<div class="box1"></div>
</body>
</html>