CSS: Special Fluid Layout Problems

前端 未结 5 731
情话喂你
情话喂你 2021-01-19 02:25

\"alt

See attached image. How is this accomplished? Gosh, I\'ve been going CSS for 8 years but somehow n

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-19 02:50

    This new approach doesn't break the layout as the content box (right) organically grows. Also it allows to safely apply backgrounds and borders to the container box.

    .container {
        width: 100%;
        height: 100px;
        overflow: hidden;
        position: relative;
    }
    
    .left {
        position: absolute;
        width: 80px;
        height: 100%;
    }
    
    .right {
        position: relative;
        left: 80px;
        top: 0;
        margin-right: 100px;
        height: 100%;
    }
    

    See demo.

提交回复
热议问题