three column web design with variable sides

痴心易碎 提交于 2019-12-02 06:08:11

Use this technique, and simply specify a fixed width for the centre column.

Check this out: http://www.glish.com/css/2.asp

And replace the width: xx% for #maincenter by a fixed value. Seems to work when I change it with Firebug, worth a shot?

#maincenter {
    width: 200px;
    float:left;
    background:#fff;
    padding-bottom:10px;
    }

I think you'd need to start off with initial (fixed) widths for both sidebar columns and then, when the page loads, use javascript to get the window width and calculate the new width of the sidebars.

sidebar width = (window width - center column width) / 2

You could then reapply the javascript if the window is resized.

This article at A List Apart has a solution resulting in a 3-column layout that will :

  • have a fluid center with fixed width sidebars,

  • allow the center column to appear first in the source,

  • allow any column to be the tallest,

  • require only a single extra div of markup, and

  • require very simple CSS, with minimal patches.

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