Three column web design with variable sides

后端 未结 4 963
时光说笑
时光说笑 2021-01-22 06:19

I\'ve been trying to come up with a way to create a 3 column web design where the center column has a constant width and is always centered. The columns to the left and right a

4条回答
  •  有刺的猬
    2021-01-22 06:37

    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.

提交回复
热议问题