How can I prevent HTML elements from overlapping or sliding under one another?

后端 未结 2 368
萌比男神i
萌比男神i 2021-01-05 10:28

I am trying to layout a page in three columns, I want the middle column to resize with the page but the problem is that if the page is made very narrow, the left column eith

2条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-05 11:04

    A solution would be to add this to the CSS:

    html {
    min-width: 550px;
    position: relative;
    }
    

    demo: http://jsfiddle.net/4PH4B/

    The basic idea is that when the page reaches the sum of all the column's widths it should no longer shrink, instead just show the scroll bar. Also the position: relative; declaration is there to align the third column to the right side of the html content, not just the window.

提交回复
热议问题