How do I stop these divs from overlapping?

前端 未结 6 1265
悲哀的现实
悲哀的现实 2020-12-16 20:31

I have three divs, within a content div.

Container width 70%. Within that I have -Left, width 20%. -Content, width 60%. -Right, width 20%.

I would like co

6条回答
  •  爱一瞬间的悲伤
    2020-12-16 21:24

    Just remove the min-width from your CSS! And give min-width to the container with margin: auto to make it center.

    Try this CSS:

    #container{
        width: 70%;
        min-width: 1000px;
        margin: auto;
    }
    #left {
        float: left;
        width: 20%;
    }
    #content {
        float: left;
        width: 60%;
    }
    #right {
        float: right;
        width: 20%;
    }
    

    Check out fiddle here: http://jsfiddle.net/UaqU7/2/

提交回复
热议问题