How to make a div fill a remaining horizontal space?

前端 未结 25 1435
野的像风
野的像风 2020-11-22 00:45

I have 2 divs: one in the left side and one in the right side of my page. The one in the left side has fixed width and I want the one of the right side to f

25条回答
  •  醉酒成梦
    2020-11-22 01:45

    I ran into this same problem trying to layout some jqueryUI controls. Although the common philosophy now is "use DIV instead of TABLE", I found in my case using TABLE worked much better. In particular, if you need to have straightforward alignment within the two elements (e.g., vertical centering, horizontal centering, etc.) the options available with TABLE give simple, intuitive controls for this.

    Here's my solution:

    
    
      Sample solution for fixed left, variable right layout
      
    
    
    
    
    Right

提交回复
热议问题