首页 > 代码库 > css基础练习二(采用3D旋转,隐藏占用位置的方式)

css基础练习二(采用3D旋转,隐藏占用位置的方式)

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
.d1{
width: 100px;
height: 30px;
border: 1px solid black;
text-align: center;
line-height: 30px;
/*圆角*/
border-radius: 10px;

}

.d1:hover{
background-color: greenyellow;
color: red;
/*渐变效果*/
transition: 1s;
/*阴影*/
box-shadow: 5px 5px 5px black;
text-shadow: 2px 2px 2px black;
/*旋转*/
/*transform: rotate(5deg);*/
/*3D旋转*/
transform: rotateX(360deg);
/*平移*/
/*margin-left: 10px;*/
/*半透明*/
opacity: 0.5;
}
a{
text-decoration: none;
color: black;
}

a:visited{
text-decoration: none;
color: black;
}

.d2{
width: 100px;
height: 100px;
border: 1px solid black;
position: relative;
}

.d2 div{
width: 50px;
height: 40px;
border: 1px solid black;
position: relative;
}

#xxx{
width: 30px;
height: 20px;
/*隐藏占用位置*/
visibility: hidden;
/*隐藏不占用位置*/
/*display: none;*/
}

.d2:hover #xxx{
color: red;
}
/*列表常用样式*/
ul{
/*list-style: none;*/
list-style-image: url(img/1.gif)
}
ul li{
/*float: left;*/
width: 50px;
}
</style>
</head>
<body>
<a href="http://www.mamicode.com/#"><div class="d1">按&nbsp;钮</div></a>
<div class="d2">
<div id="xxx">ABCD</div>
<div>1234</div>
</div>
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
</ul>


</body>
</html>

css基础练习二(采用3D旋转,隐藏占用位置的方式)