Thursday 15 July 2010

html - Make Div take up the remaining width -


Actually I have 2 DIVs in a fixed width. Now I want the other person to take the remaining width.

I can only get it by putting the flight on a fixed-width-deck - this is right for me, but it only works when I swipe the DIV in my HTML (right one first Comes). I did not like it in this way.

So is there a way to get this right setup, but without excluding DIV in your HTML?

& Lt; Div id = "wrap" & gt; & Lt; Div id = "right" & gt; True & lt; / Div & gt; & Lt; Div id = "left" & gt; Left & lt; / Div & gt; & Lt; / Div & gt;

css

  #wrap {width: 300px; } #left {width: 100%; Background color: # ff0000; } #right (float: right; width: 50px; background color: # 00FF00;}  

You can try and display: flex; , I think this is your desired.


No comments:

Post a Comment