为了账号安全,请及时绑定邮箱和手机立即绑定

怎么做那个导航栏 首页文章页,border-bottom 的向左向右消失,显示的过渡效果呢

怎么做那个导航栏 首页文章页,border-bottom 的向左向右消失,显示的过渡效果呢

正在回答

2 回答

直接上代码吧:


HTML:

                <div id="banner">
			<div class="inner">
				<h1 class="banner-title">西风博客
				<span class="line line-top"></span>
				<span class="line line-bottom"></span>
				</h1>
				<div class="sub-heading">Lorem ipsum dolor sit amet, consectetur adipisicing elit. </div>
				<button>了解我</button>
				<div class="more">
					更多
					<i class="icon-angle-down icon-2x"></i>
					<!-- <p><i class="icon-angle-down icon-2x"></i></p> -->
				</div>
				
			</div>
		</div>

CSS:

#banner .inner{
	max-width: 300px;
	text-align: center;
	margin: 0 auto;
	position: relative;
	top: 160px;
	color:#fff;
}

.banner-title{
	position: relative;
	height: 38px;
	line-height: 38px;
	padding: 10px 0;
	border-top: 2px solid #ddd;
	border-bottom: 2px solid #ddd; 

}

.banner-title .line{
	display: block;
	position: absolute;
	background: none;
	background-color: #fff;
}
@keyframes left-right{
	0%,30%{
		width: 0;
	left: -100px;
	}
	100%{
		width: 100%;
		left:0;
	}
}
@keyframes right-left{
	0%,30%{
		width: 0;
	right: -100px;
	}
	100%{
		width: 100%;
		right:0;
	}
}
.banner-title .line-top{
	height: 2px;
	width: 100%;
	top: -2px;
	animation:left-right 1s ease;
} 

.banner-title .line-bottom{
	width: 100%;
	height: 2px;
	bottom: -2px;
	animation:right-left 1s ease;
}


0 回复 有任何疑惑可以回复我~

用css3的transition吧。

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
CSS3扁平化博客之文章页及常用组件
  • 参与学习       36307    人
  • 解答问题       54    个

又一波 CSS3扁平化博客

进入课程

怎么做那个导航栏 首页文章页,border-bottom 的向左向右消失,显示的过渡效果呢

我要回答 关注问题
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号