cpwl
cpwl
  • 发布:2019-09-14 22:14
  • 更新:2019-09-14 22:14
  • 阅读:521

div中的div居中问题 为何jpg图标不居中于.a而.xiaofu也不居中于.content呢??????

分类:HTML5+
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>cowl</title> <style> *{ margin: 0 ; padding: 0; } body{ background: #28c76f; } #content{ width: 1000px; height: 1000px; margin: 0 auto; } .xiaofu{ float: left;
	}  
	.a{  
		width: 300px;  
		height: 300px;  
		border: 1px solid red;  
	}  
	.b{  
		width: 300px;  
		height: 300px;  
		background: #28c76f;  
		border: 1px solid red;  
	}  
	.b h3{  
		text-align:center;  
		line-height: 300px;  
		  
	}  

</style>  
</head> <body> <div id="content"> <div class="xiaofu"> <div class="a"><img src="13.jpg" alt=""></div> <div class="b"><h3>xiaohua</h3></div> </div> <div class="xiaofu"> <div class="a"><img src="53.jpg" alt=""></div> <div class="b"><h3>xiaohua</h3></div> </div> <div class="xiaofu"> <div class="a"><img src="54.jpg" alt=""></div> <div class="b"><h3>xiaohua</h3></div> </div> </div> </body> </html>
2019-09-14 22:14 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复