Two-Column CSS Layout without having to specify the right column

大兔子大兔子 提交于 2019-12-06 16:05:31

The trick is to put overflow:hidden into the right panel:

#left, #right {
       border: solid 1px #000000;
}

#left {
      float: left;
      width: 10%;
}

#right {
       overflow: hidden;
}

This would do it for you:

#left {
    position: absolute;
    left: 0;
    top: 0;
    width: 200px;
}

#right {
    padding-left: 200px;
}

I believe what you already have fulfills your needs if you open it in IE. But, for Firefox set display property of those two divs to table. Note that this value is undefined in IE.

#left, #right {
    border: solid 1px #000000;
    display: table;
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!