开发者社区> 问答> 正文

这种布局能否用纯css实现

如图,左边的头像部分是固定的,但是右边的宽度是随着父元素的宽度而变化的,虽然可以通过js计算后来控制它的宽,我想问可不可以用纯css来实现?
screenshot

展开
收起
杨冬芳 2016-06-23 15:58:01 1830 0
1 条回答
写回答
取消 提交回答
  • IT从业
    <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>

    screenshot

    2019-07-17 19:46:29
    赞同 展开评论 打赏
问答分类:
问答标签:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
零基础CSS入门教程 立即下载
低代码开发师(初级)实战教程 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载