左侧宽度固定,右侧宽度自适应-----两种布局样式

下面是两种布局方式

html

<div class="t1">
       <div class="one">1</div>
       <div class="two">2</div>
</div>

css1样式布局1

.one{
  float:left;
  300px;
  height:200px;
  background-color: pink;
}
.two{
  margin-left: 300px;
  height:200px;
  background-color: #f40;
}

css2样式布局2

.one{
       position:absolute;
       300px;
       height:200px;
       background-color: pink;
}
.two{
       margin-left: 300px;
       height:200px;
       background-color: #f40;
}
原文地址:https://www.cnblogs.com/zwp06/p/7477446.html