微博输入框HTML+CSS整体布局

原创 2018-11-28 16:32:10 341
摘要:<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>微博输入框</title> <link rel="stylesheet" type="text/css&q
<!DOC
<html>
<head>
	<meta charset="utf-8">
	<title>微博输入框</title>
	<link rel="stylesheet" type="text/css" href="../css/css.css">
	<link rel="shortcut icon" type="image/x-icon" href="../picture/mi.png">
	<style type="text/css">
	/*body内容里字体大小*/
	    body{font-size:12px;}
		.box{width: 521px;height: 130px;border: 6px solid pink;margin: 5px auto;padding: 10px;}/*整个微博输大体框架*/
		.box1{width: 100px;height: 24px;float: right;text-align: right;color: #ccc;font-weight: bold;}
		/*.clear{clear: both;}*/
		.box1 span{font-size: 20px;font-weight: bold;}
		.text{width: 521px;height:70px;border: 2px solid #ccc; }/*微博内容输入框*/
		#sp1,#sp2,#sp3,#sp4,#sp5,#sp6{float: left; width: 30px;height: 25px;margin-top: 5px;padding-left: 26px; line-height: 25px;}
		/*背景图片靠padding-left:26px寄出来*/
		#sp1{background: url(../picture/images/an5.png) no-repeat left;}
		#sp2{background: url(../picture/images/an4.png) no-repeat left;}
		#sp3{background: url(../picture/images/an3.png) no-repeat left;}
		#sp4{background: url(../picture/images/an2.png) no-repeat left;}
		#sp5{background: url(../picture/images/an1.png) no-repeat left;width: 40px;}
		#sp6{margin-left: 100px;}
		#bt{width: 75px;height: 25px;margin-top: 5px;line-height: 25px;border: none;background: #FFC7A0;}/*发表按钮属性*/

	</style>
</head>
<body>
     <!-- 最外层Div -->
    <div class="box">
	<img src="../picture/images/12.png">
	<!-- 计算输入字数的Div -->
	<div class="box1">还可以输入<span id="number"></span>字</div>
	<!-- <div class="clear"></div>清除浮动影响div -->
	<textarea class="text"></textarea>
	<span id="sp1">表情</span>
	<span id="sp2">图片</span>
	<span id="sp3">视频</span>
	<span id="sp4">话题</span>
	<span id="sp5">长微博</span>
	<span id="sp6">公开</span>
	<input type="button" value="发表" id="bt">
</div>
</body>
</html>

  通过该小节的学习让我更加熟习之前学习的布局相关内容,该内容里边有一个padding-left:26px , 如果没有该属性,我的背景图片在字的下边,这是靠内边距把<span></span>标签的内容给挤走了吗?

发布手记

热门词条