Need CSS sidebar height to expand with content

前端 未结 8 1321
情深已故
情深已故 2021-01-07 00:20

I have a two column layout, with a gray sidebar on the right. I need the sidebar\'s height to expand when the height of the left column is increased (due to content being dy

8条回答
  •  春和景丽
    2021-01-07 00:44

    I'm guessing you want to apply certain effect to your layout such that it will require both columns to resize together. If you want to dynamically change the values of the height of the columns, I doubt it will work simply with css unless you implement some javascript to control the style.

    As Dal suggested, do look at the link on faux columns. As the name suggests, the solution isn't much about modifying the columns height. Instead, it gives the "illusion" that both columns appear to be of the same height when in reality they are not -- and is with the use of tiles of background image.

    The idea is there isn't a need to complicate the mark-up. Simple structure with a touch of "illusion" with images is a common practice in web design.

    Regards, Jonah

提交回复
热议问题