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>

  

相关文章:

  • 2022-02-09
  • 2022-12-23
  • 2021-09-30
  • 2021-06-14
  • 2022-12-23
  • 2022-12-23
  • 2022-02-09
  • 2021-10-10
猜你喜欢
  • 2021-12-18
  • 2022-02-09
  • 2021-09-04
  • 2022-02-09
  • 2022-02-09
相关资源
相似解决方案