分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 软件开发

css实现特殊效果

发布时间:2023-09-06 01:32责任编辑:彭小芳关键词:暂无标签

二级导航翻转效果:
/*html*/
<ul>
???<li>111</li>
???<li>222</li>
???<li>333
???????<ol>
???????????<li>444</li>
???????????<li>555</li>
???????????<li>666</li>
???????</ol>
???</li>
</ul>
/*css*/

li{
???list-style: none;
???margin-right: 30px;
}
ul>li{
???float: left;
}
ul>li:hover{
???color:orange;
}
ul,ol{
???padding: 0;
???margin: 0;
}
ol>li{
???opacity: 0;
???transition: all 2s;
???transform: rotatey(180deg);
???color: blue;
???background: gainsboro;
}
ul>li:last-child:hover ol>li:first-child{
???opacity: 1;
???transform: none;
???transition-delay: 0s;
}
ul>li:last-child:hover ol>li:nth-child(2){
???opacity: 1;
???transform: none;
???transition-delay:200ms;
}
ul>li:last-child:hover ol>li:last-child{
???opacity: 1;
???transform: none;
???transition-delay: 400ms;
}

从文字下方中间添加下划线:
/*html*/
<ul class="box">
???<li>ddd</li>
???<li>ff</li>
???<li>ggg</li>
</ul>
/*css*/
.box li{
???list-style: none;
???float: left;
???text-align: center;
???margin-left: 10px;
???position: relative;
???padding-bottom: 20px;
}
从文字下方左边添加下划线:
/*html*/
<ul class="box1">
???<li>ddd</li>
???<li>ff</li>
???<li>ggg</li>
</ul>
/*css*/
.box1 li{
???list-style: none;
???float: left;
???width: 80px;
???text-align: center;
???margin-left: 100px;
???position: relative;
???padding-bottom: 20px;
???/*background: red;*/
}
.box1 li:before{
???content:"";
???position:absolute ;
???/*border: 2px solid red;*/
???width: 0;
???left:-100%;
???bottom: 0;
???transition: all linear 2s;
???/*display: none;*/
}
.box1 li:hover:before{
???border: 2px solid red;
???width:100%;
???left:0;

css实现特殊效果

原文地址:http://www.cnblogs.com/huan123/p/8098719.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved