如图,左边的头像部分是固定的,但是右边的宽度是随着父元素的宽度而变化的,虽然可以通过js计算后来控制它的宽,我想问可不可以用纯css来实现?
1 回答
慕慕森
TA贡献1856条经验 获得超17个赞
<div class="a1" style="position: relative;"> <div class="a2" style=" width: 100px; height: 100px; position: absolute; left: 0; top: 0; background: red;"></div> <div class="a3" style=" margin-left: 120px; background: blue; height: 100px;"></div> </div>
添加回答
举报
0/150
提交
取消