HTML左邊盒子固定,右邊盒子自適應


html:

<div class="box1">
	<div class="divA">DIVA</div>
	<div class="divB">DIVB</div>
</div>

 css:

<style type="text/css">
			* {
				margin: 0;
				padding: 0;
			}
			
			.box1 {
				width: 100%;
				height: 300px;
				background: #008000;
				padding:1px;
				box-sizing: border-box;
			}
			.divA {
				width: 150px;
				height: 150px;
				background: red;
				text-align: center;
				float: left;
			}
			
			.divB {
				margin-left: 150px;
				height: 260px;
				background: blue;
				text-align: center;
				margin-top: 20px;
			}
		</style>

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM