首页 > 代码库 > css代码2D/3D

css代码2D/3D

关键部分的CSS代码:

.menu ul {    list-style-type: none;    border-top: 10px solid gray;}.menu ul li a {    color: #fff;    float: left;    margin: 0 5px;    font-size: 15px;    height: 50px;    line-height: 50px;    text-align: center;    width: 80px;    padding: 10px 5px;    border-radius: 0 0 5px 5px;    box-shadow: 0 0 1px #000, inset 0 0 2px #000;    text-shadow: 0 2px 2px #000;    text-decoration: none;}.menu ul li a {    background: #2EC7D2;}.menu ul li.translate a:hover {    transform: translate(-10px, -10px);}.menu ul li.translate-x a:hover {    transform: translateX(-10px);}.menu ul li.translate-y a:hover {    transform: translateY(-10px);}.menu ul li.rotate a:hover {    transform: rotate(30deg);}.menu ul li.scale a:hover {    transform: scale(0.8, 0.8);}.menu ul li.scale-x a:hover {    transform: scaleX(0.8);}.menu ul li.scale-y a:hover {    transform: scaleY(1.2);}.menu ul li.skew a:hover {    transform: skew(30deg, 30deg);}.menu ul li.skew-x a:hover {    transform: skewX(-30deg);}.menu ul li.skew-y a:hover {    transform: skewY(30deg);}.menu ul li.matrix a:hover {    transform: matrix(1, 1, -1, 0, 0, 0);}.menu ul li.rotate-y a:hover {    transform:rotateY(120deg);}.menu ul li.rotate-z a:hover {    transform:rotateZ(120deg);}.menu ul li.perspective a:hover {    transform:perspective(50px) rotateY(30deg);}.menu ul li.transform-origin a {    transform-origin: left;}

部分html代码:

<div class="menu">    <ul class="clearfix">        <li class="item translate"><a href="#">Translate</a></li>        <li class="item translate-x"><a href="#">TranslateX</a></li>        <li class="item translate-y"><a href="#">TranslateY</a></li>        <li class="item rotate"><a href="#">Rotate</a></li>        <li class="item scale"><a href="#">Scale</a></li>        <li class="item scale-x"><a href="#">ScaleX</a></li>        <li class="item scale-y"><a href="#">ScaleY</a></li>        <li class="item skew"><a href="#">Skew</a></li>        <li class="item skew-x"><a href="#">SkewX</a></li>        <li class="item skew-y"><a href="#">SkewY</a></li>        <li class="item matrix"><a href="#">Matrix</a></li>        <li class="item rotate-y"><a href="#">RotateY</a></li>        <li class="item rotate-z"><a href="#">RotateZ</a></li>        <li class="item perspective"><a href="#">perspective</a></li>    </ul></div>

css代码2D/3D