html - Dividing div height over child elements -


I am doing some html and css.

I currently have a problem with a div fields that I want to fill the entire div's height with my fields so if my div is 300px high then both fields should be 150px. I do not want to have a certain height in my box. I also do not want to work with the situation: Absolute.

I made

As you can see that there is a vacant place at the end of the div, I want to take the field blank.

This is my code:

  & lt; Div id = "thediv" & gt; & Lt; Story & gt; Somefieldset & lt; / Narrative & gt; & Lt; Fieldet id = "one" & gt; & Lt; Input type = "text" value = "input 1" & gt; & Lt; Input type = "text" value = "input2" & gt; & Lt; / Fieldset & gt; & Lt; Story & gt; Somefieldset2 & lt; / Narrative & gt; & Lt; Fieldet id = "two" & gt; & Lt; Input type = "text" value = "input3" & gt; & Lt; / Fieldset & gt; & Lt; / Div & gt; #thediv {min-height: 300px; Border: 1 px black solid; Width: 50%; } # One, # two {margin: 0; Padding: 0; Swim left; Width: 100%; }  

I hope my question is clear. If it is not, leave a comment.

Did you display: flex ? It is supported with vendor subfixes in Chrome, Firefox and IE10 + and slightly different syntax in IE10 Display: Flex

Thediv {Min-height: 300px; Border: 1 px black solid; Width: 50%; Exhibit: Flex; Flex-direction: column; } # One, # two {Flex: 1; Margin: 0; Padding: 0; Swim left; Width: 100%; }


Comments

Popular posts from this blog

HTML/CSS - Automatically set height width from background image? -

php - Mysql Show Process - Sleep Commands and what to do -

c - What is the address of buf (the local variable in the main function)? -