1、 vertical-align: middle; 把此元素位置放在父元素中部
2、元素前加一个块级元素:
.class::befoer{
content:"";
display: inline-block;
width:10px;
height:10px;
}
3、旋转、过渡:
-webkit-transform: translateX(-50%) scale(0);
-moz-transform: translateX(-50%) scale(0);
-o-transform: translateX(-50%) scale(0);
-ms-transform: translateX(-50%) scale(0);
transform: translateX(-50%) scale(0);
-webkit-transition: transform 0.4s, opacity 0.4s;
-moz-transition: transform 0.4s, opacity 0.4s;
-o-transition: transform 0.4s, opacity 0.4s;
-ms-transition: transform 0.4s, opacity 0.4s;
transition: transform 0.4s, opacity 0.4s;
4、字体转换
text-transform: uppercase;
font-family: Arial;
5、元素的透明度:
opacity: 0.1;
6、字体之间的间距:
letter-spacing: 19px;
7、内容超出隐藏、不换行:
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
8、背景颜色从中间到两边过渡:
.service .fwNav a{
float: left;
display: block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 160px;
height: 45px;
border-radius: 22px;
border: solid 1px #f0f0f0;
margin-left: 10px;
margin-top: 10px;
text-align: center;
line-height: 43px;
padding: 0 5px;
color: #6d6d6d;
font-size: 15px;
background-repeat: no-repeat;
background-image: -webkit-linear-gradient(left, #019959, #019959);
background-image: linear-gradient(to right, #019959, #019959);
background-size: 0% 100%;
background-position: center center;
-webkit-transition: all 0.5 ease-out;
transition: all 0.5 ease-out;
}
.service .fwNav a:hover{
background-size: 100% 100%;
color: #fff;
border-color: #019959;
}
9、过渡效果:越来越慢
-webkit-transition:all 0.5s ease-out;
transition: all 0.5s ease-out;
10、超出隐藏 超过两行之后省略号
display: -webkit-box;
-webkit-box-orient:vertical;
-webkit-line-clamp: 2;
overflow: hidden;