秋风_irwin 2017-06-06 12:09 采纳率: 50%
浏览 1660
已采纳

css实现三列布局(不用css3)

图片说明

实现如图,间距都是固定的,但是三列实现自适应效果,即三列随屏幕变宽,都是等比增加,但是中间的间距不变。不用css3的flex,用css2实现。

  • 写回答

3条回答 默认 最新

  • BloodyMandoo 2017-06-07 05:16
    关注
        <div>
            <div style="background: yellow; float: left; width: 33.333%;">
                <div style="margin: 0 6px 0 2px; background: red; "></div>
            </div>
    
            <div style="background: blue; float: left; width: 33.333%;">
                <div style="margin: 0 4px 0 4px; background: red; "></div>
            </div>
    
            <div style="background: green; float: left; width: 33.333%; ">
                <div style="margin: 0 2px 0 6px; background: red; "></div>
            </div>
        </div>
    
            总是把前面的剪了,强迫症不能忍!
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?