老师我设置了小icon的运动怎么没有显示
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="./css/common.css">
<link rel="stylesheet" href="./css/index.css">
<link rel="stylesheet" href="./css/ui.css">
<title>幕淘网</title>
</head>
<body>
<!-- top部分 -->
<div class="top">
<div class="center">
<div class="left top-left">
<ul>
<li class="left">
<a href="#1" style="color: #f01414;">亲,请登录</a></li>
<li class="left"><a href="#1">免费注册</a></li>
<li class="left"><a href="#1">手机逛幕多多</a></li>
</ul>
</div>
<div class="right">
<div class="top-dropdown">
<div class="left dropdown-item ">
<div class="dropdown-toggle">
<a href="">我的幕多多</a>
<i class="dropdown-icon"></i>
</div>
<ul class="dropdown-layer dropdown-left">
<li>
<a href="" class="dropdown-items">已买到的宝贝</a>
<a href="" class="dropdown-items">我的足迹</a>
</li>
</ul>
</div>
<div class="left dropdown-item">
<div class="dropdown-toggle"> <a href=""> 收藏夹</a><i class="dropdown-icon"></i></div>
<ul class="dropdown-layer dropdown-left">
<li><a href="###" target="_blank" class="dropdown-items">收藏的宝贝</a></li>
<li><a href="###" target="_blank" class="dropdown-items">收藏的店铺</a></li>
</ul>
</div>
<div class="left dropdown-item">
<div class="dropdown-toggle"> <a href=""> 商品分类</a></div>
</div>
<div class="left dropdown-item">
<div class="dropdown-toggle"><a href="">卖家中心</a><i class="dropdown-icon"></i></div>
<ul class="dropdown-layer dropdown-left">
<li><a href="###" target="_blank" class="dropdown-items">免费开店</a></li>
<li><a href="###" target="_blank" class="dropdown-items">已卖出的宝贝</a></li>
<li><a href="###" target="_blank" class="dropdown-items">出售中的宝贝</a></li>
<li><a href="###" target="_blank" class="dropdown-items">卖家服务市场</a></li>
<li><a href="###" target="_blank" class="dropdown-items">卖家培训中心</a></li>
<li><a href="###" target="_blank" class="dropdown-items">体验中心</a></li>
</ul>
</div>
<div class="left dropdown-item ">
<div class="dropdown-toggle"><a href=""> 联系客服</a><i class="dropdown-icon"></i></div>
<ul class="dropdown-layer dropdown-right">
<li><a href="###" target="_blank" class="dropdown-items">消费者客服</a></li>
<li><a href="###" target="_blank" class="dropdown-items">卖家客服</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<!---------------------------------------- top部分 ------------------------------->
<!---------------------------------- logo部分------------------------------- -->
<div class="logo">
<div class="center">
<div class="logo-logo left">
<a href="" class="logo-logo-img"></a>
</div>
<div class="logo-search left">
<form action="https://s.taobao.com/search" id="form">
<input type="text" placeholder="灵魂没事一元抢" name="q" class="left search-input" autocomplete="off"></input>
<input type="submit" value="搜索" class="left search-submit"></input>
</form>
<ul class="search-layer">
<!-- <li class="search-layer-item text-ellipsis">123</li>
<li class="search-layer-item text-ellipsis">123</li>
<li class="search-layer-item text-ellipsis">123</li> -->
</ul>
</div>
</div>
</div>
</div>
</div>
<!-- -----------------------------------logo部分----------------------------------------- -->
<!-- -----------------------------------------------nav部分---------------------------------------- -->
<div class="nav">
<div class="center">
<div class="nav-item">
<a href="">数码城</a>
<a href="">天黑黑</a>
<a href="">团购</a>
<a href="">发现</a>
<a href="">二手特价</a>
<a href="">名品汇</a>
</div>
</div>
</div>
<!-- -----------------------------------------------nav部分---------------------------------------- -->
<!-- -----------------------------------banner部分----------------------------------------- -->
<div class="banner">
<div class="center clearfloat">
<!-- 商品分类 -->
<div class="commodity left"></div>
<!-- 轮播图 -->
<div class="slideshow left">
<div class="slideshow-img" style="left: -728px;">
<img src="./作业素材/code/img/focus-slider/5.jpg" alt="">
<img src="./作业素材/code/img/focus-slider/1.jpg" alt="">
<img src="./作业素材/code/img/focus-slider/2.jpg" alt="">
<img src="./作业素材/code/img/focus-slider/3.jpg" alt="">
<img src="./作业素材/code/img/focus-slider/4.jpg" alt="">
<img src="./作业素材/code/img/focus-slider/5.jpg" alt="">
<img src="./作业素材/code/img/focus-slider/1.jpg" alt="">
</div>
<div class="slideshow-button">
<span class="slideshow-button-item slideshow-button-item-act" data-index="1"></span>
<span class="slideshow-button-item" data-index="2"></span>
<span class="slideshow-button-item" data-index="3"></span>
<span class="slideshow-button-item" data-index="4"></span>
<span class="slideshow-button-item" data-index="5"></span>
</div>
<a href="#2" class="arrow" id="prev"><</a>
<a href="#2" class="arrow" id="next">></a>
</div>
<!-- 便民服务 -->
<div class="services right">
<div class="services-top">
<div class="services-top-title">
<div class="left title">慕快报</div>
<a href="" class="right">更多 ></a>
</div>
<div class="services-top-items">
<a href="" class="services-item">[公告] 幕多多启用新客服电话</a>
<a href="" class="services-item">[活动] 优选好货</a>
<a href="" class="services-item">[公告] 中差评论功能升级</a>
<a href="" class="services-item">[公告] 陌生人拼团上线</a>
<a href="" class="services-item">[新闻] 售假获刑又起诉</a>
</div>
</div>
<div class="services-middle">
<div class="services-middle-item">
<a>
<p class='iconfont'></p>
<p>话费</p>
</a>
</div>
<div class="services-middle-item">
<a>
<p class='iconfont'></p>
<p>机票</p>
</a>
</div>
<div class="services-middle-item">
<a>
<p class='iconfont'></p>
<p>电影票</p>
</a>
</div>
<div class="services-middle-item">
<a>
<p class='iconfont'></p>
<p>游戏</p>
</a>
</div>
<div class="services-middle-item">
<a>
<p class='iconfont'></p>
<p>彩票</p>
</a>
</div>
<div class="services-middle-item">
<a>
<p class='iconfont'></p>
<p>加油卡</p>
</a>
</div>
<div class="services-middle-item">
<a>
<p class='iconfont'></p>
<p>酒店</p>
</a>
</div>
<div class="services-middle-item">
<a>
<p class='iconfont'></p>
<p>火车票</p>
</a>
</div>
<div class="services-middle-item">
<a>
<p class='iconfont'></p>
<p>众筹</p>
</a>
</div>
<div class="services-middle-item">
<a>
<p class='iconfont'></p>
<p>理财</p>
</a>
</div>
<div class="services-middle-item">
<a>
<p class='iconfont'></p>
<p>礼品卡</p>
</a>
</div>
<div class="services-middle-item">
<a>
<p class='iconfont'></p>
<p>多点金</p>
</a>
</div>
</div>
<div class="services-bottom"></div>
</div>
</div>
</div>
</body>
</html>
.clearfloat {
zoom: 1;
}
.clearfloat:after {
display: block;
clear: both;
content: "";
visibility: hidden;
height: 0;
}
* {
margin: 0;
padding: 0;
}
body {
overflow-y: scroll;
}
a {
text-decoration: none;
cursor: pointer;
}
a:hover {
text-decoration: none;
}
ul,
li {
list-style: none;
}
.right {
float: right;
}
.left {
float: left;
}
.center {
margin: 0 auto;
width: 1200px;
}
.text-ellipsis {
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
/*icon*/
@font-face {
font-family: "iconfont";
src: url('../font/iconfont.eot');
/* IE9*/
src: url('../font/iconfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('../font/iconfont.woff2') format('woff2'), /* */
url('../font/iconfont.woff') format('woff'), /* */
url('../font/iconfont.ttf') format('truetype'), /* */
url('../font/iconfont.svg#iconfont') format('svg');
}
.iconfont {
font-family: "iconfont" !important;
font-size: 14px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-webkit-text-stroke-width: 0.2px;
-moz-osx-font-smoothing: grayscale;
}
.top {
height: 44px;
background: #f3f5f7;
font-size: 10px;
}
.top .center {
border-bottom: 1px solid #cdd0d4;
height: 43px;
line-height: 43px;
}
.top .top-left li a {
display: inline-block;
padding-left: 25px;
color: #4d555d;
}
.top-dropdown .dropdown-item a:hover,
.top .top-left li a:hover {
color: #f01414;
text-decoration: none;
}
.top-dropdown {
height: 100%;
}
.dropdown-toggle {
position: relative;
z-index: 2;
display: block;
height: 100%;
padding: 0 16px 0 12px;
border-left: 1px solid #f3f5f7;
border-right: 1px solid #f3f5f7;
}
.top-dropdown .dropdown-item {
position: relative;
}
.dropdown-icon {
display: inline-block;
width: 8px;
height: 6px;
background: url(../作业素材/code/img/dropdown-arrow.png) no-repeat;
margin-left: 8px;
vertical-align: middle;
cursor: pointer;
}
.top-dropdown .dropdown-item a {
color: #4d555d;
}
.dropdown-left {
left: 0;
right: auto;
}
.dropdown-right {
right: 0;
left: auto;
}
.dropdown-layer {
display: none;
position: absolute;
top: 43px;
background-color: #fff;
z-index: 1;
border: 1px solid #cdd0d4;
}
.dropdown-items {
display: block;
height: 30px;
line-height: 30px;
padding: 0 12px;
color: #4d555d;
white-space: nowrap;
}
.dropdown-items:hover {
background-color: #f3f5f7;
}
.dropdown-active .dropdown-toggle,
.dropdown:hover .dropdown-toggle {
background-color: #fff;
border-color: #cdd0d4;
}
.dropdown-active .dropdown-icon,
.dropdown:hover .dropdown-icon {
background-image: url(../作业素材/code/img/dropdown-arrow-active.png);
}
.dropdown-active .dropdown-layer,
.dropdown:hover .dropdown-layer {
display: block;
}
/* -----------------top部分------------------------ */
/* ------------------logo部分------------------- */
.logo {
background: #f3f5f7;
line-height: 126px;
height: 126px;
width: 100%;
}
.logo-logo a {
cursor: pointer;
display: block;
width: 212px;
height: 58px;
margin: 36px 0 0 15px;
text-indent: -9999px;
overflow: hidden;
background: url(../作业素材/code/img/header-logo.png) no-repeat;
}
.logo-search {
width: 680px;
height: 42px;
border: 1px solid #cfd2d5;
margin-top: 38px;
margin-left: 150px;
position: relative;
}
.search-input {
width: 586px;
height: 42px;
border: none;
background: #fff;
padding: 0 10px;
line-height: 42px;
}
.search-submit {
border: none;
outline: none;
background: #ca003f;
color: #fff;
height: 42px;
width: 74px;
cursor: pointer;
}
.search-layer {
display: none;
position: absolute;
top: 100%;
left: -1px;
width: 100%;
background-color: #fff;
border: 1px solid #cfd2d5;
z-index: 99;
}
.search-layer-item {
height: 24px;
line-height: 24px;
padding: 0 10px;
cursor: pointer;
}
.search-layer-item:hover {
background-color: #f3f5f7;
}
/* ------------------logo部分------------------- */
/* ------------------nav部分------------------- */
.nav {
background: #ca003f;
width: 100%;
height: 50px;
line-height: 50px;
margin-bottom: 8px;
}
.nav .nav-item {
position: relative;
margin-left: 300px;
}
.nav .nav-item a {
display: inline-block;
height: 50px;
line-height: 50px;
margin-right: 62px;
color: #fff;
padding: 0 10px;
}
.nav .nav-item a:hover {
color: red;
background: #000000;
}
/* ----------------------------nav部分--------------------------------------- */
/* -------------------------------------banner部分--------------------------- */
.banner {
height: 504px;
width: 100%;
background: #f3f5f7;
margin-bottom: 10px;
}
.commodity {
background: #c1043f;
position: relative;
width: 208px;
height: 566px;
margin-top: -62px;
margin-right: 8px;
}
/* ----------轮播图------------------ */
.slideshow {
position: relative;
height: 504px;
width: 730px;
overflow: hidden;
}
.slideshow-img {
height: 504px;
width: 5096px;
position: absolute;
}
.slideshow-img img {
float: left;
}
.slideshow .arrow {
position: absolute;
color: #fff;
background: #000000;
height: 90px;
width: 46px;
line-height: 90px;
font-size: 35px;
text-align: center;
display: none;
}
.slideshow #prev {
left: 0;
top: 50%;
margin-top: -45px;
}
.slideshow #next {
right: 0;
top: 50%;
margin-top: -45px;
}
.slideshow-button {
position: absolute;
bottom: 0;
left: 50%;
margin-bottom: 26px;
margin-left: -46px;
display: none;
}
.slideshow-button .slideshow-button-item {
float: left;
display: block;
height: 7px;
width: 7px;
background: grey;
margin-right: 12px;
border: 1px solid #fff;
border-radius: 50%;
cursor: pointer;
}
.slideshow .slideshow-button .slideshow-button-item-act {
background: #fff;
border: 1px solid grey;
}
/* ------------便民服务---------- */
.services {
height: 504px;
width: 248px;
}
.services .services-top {
height: 197px;
width: 247px;
border: 1px solid #d9dde1;
border-bottom: none;
}
.services-top-title {
height: 52px;
width: 100%;
line-height: 52px;
}
.services-top-title a {
color: #4d555d;
font-size: 11px;
margin-right: 30px;
}
.services-top-title .title {
color: #f01414;
margin-left: 16px;
font-size: 18px;
}
.services-top-items {
width: 100%;
height: 162px;
margin-left: 16px;
}
.services-item {
display: block;
height: 14px;
margin-bottom: 15px;
color: #4d555d;
font-size: 13px;
}
.services-top-items a:hover {
color: #f01414;
}
.services .services-middle {
height: 216px;
width: 248px;
border-left: 1px solid #d9dde1;
}
.services-middle-item {
width: 61px;
height: 71px;
border-top: 1px solid #d9dde1;
border-right: 1px solid #d9dde1;
float: left;
}
.services-middle-item:hover {
box-shadow: 0 0 10px inset rgba(0, 0, 0, 0.6);
}
.services-middle-item .iconfont {
color: #f67272;
font-size: 23px;
}
/* 运动 */
.services-middle-item:hover .iconfont {
-webkit-transform: translateY(-20px) 0.6s ease-in-out;
-moz-transform: translateY(-20px) 0.6s ease-in-out;
-o-transform: translateY(-20px) 0.6s ease-in-out;
transform: translateY(-20px) 0.6s ease-in-out;
-webkit-transition: -webkit-transform .6s;
-moz-transition: -moz-transform .6s;
-ms-transition: -ms-transform .6s;
-o-transition: -o-transform .6s;
transition: transform .6s;
}
/* @keyframes move {
0% {
transform: translateY(-10px);
}
100% {
transform: translateY(0);
}
}
*/
.services-middle-item p {
font-size: 2px;
}
.services-middle-item a {
margin-top: 18px;
display: block;
text-align: center;
}
.services .services-bottom {
height: 89px;
width: 248px;
background: url(../作业素材/code/img/focus-ad.png);
}
/* -----------------------------banner部分-------------------------------- */
正在回答
同学你好,transform的语法写错了。建议:在hover时,修改垂直方向上的位置就可以了,可以参考下方的代码
如果我的回答帮到了你,欢迎采纳,祝学习愉快~
.services-middle-item:hover .iconfont {
-webkit-transform: translateY(-20px) 0.6s ease-in-out;
-moz-transform: translateY(-20px) 0.6s ease-in-out;
-o-transform: translateY(-20px) 0.6s ease-in-out;
transform: translateY(-20px) 0.6s ease-in-out;
-webkit-transition: -webkit-transform .6s;
-moz-transition: -moz-transform .6s;
-ms-transition: -ms-transform .6s;
-o-transition: -o-transform .6s;
transition: transform .6s;
}
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星