前端基础-CSS滑动门效果

二、滑动门效果

概念:3个盒子浮动,左边和右边写宽高,负责加载两边的背景,中间的盒子宽度不定,让文字撑开

<head>
	<meta charset="UTF-8">
	<title>滑动门</title>
	<style type="text/css">
		.box{
			height:33px;
			margin-left:300px;
		}
		.box div{
			float:left;
			height:33px;
		}
		.left{
			width:18px;
			background:url(img/left.png);
		}
		.center{
			line-height:33px;
			color:#fff;
			background:url(img/center.png);
		}
		.right{
			width:17px;
			background:url(img/right.png);
		}
	</style>
</head>
<body>
	<div class="box">
		<div class="left"></div>
		<div class="center">这是文字进来了</div>
		<div class="right"></div>
	</div>	
</body>
效果
在这里插入图片描述

字间距

单词间距

发布了2042 篇原创文章 · 获赞 2210 · 访问量 20万+

猜你喜欢

转载自blog.csdn.net/weixin_42528266/article/details/105204450