html - 100% div height -


Everyone

I am preparing a webpage with a liquid layout. I want to keep the width of 100% and the height 100%. The problem is that I do not know the way to keep "left" and "right" divs with 100% height inside my parents div "wrapper"

  & lt; Div id = "container" style = "width: 100%; height: 100%" & gt; & Lt; Div id = "header" style = "width: 100%; height: 100px" & gt; & Lt; / Div & gt; & Lt; Div id = "wrapper" style = "width: 100%; height: (100% - 100px)" & gt; & Lt; Div id = "left" style = "width: 250px; height: (100% - 100px)" & gt; & Lt; / Div & gt; & Lt; Div id = "right" style = "width: (100% - 250px); height: (100% - 100px)" & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt;  

Please help.

Answer from doctype.com

css

  html, body {height: 100%; Margin: 0; Padding: 0; }  

HTML

  & lt; Body & gt; & Lt; Div id = "container" style = "width: 100%; height: 100%; condition: complete;" & Gt; & Lt; Div id = "header" style = "width: 100%; height: 100px;" & Gt; Header & lt; / Div & gt; & Lt; Div id = "wrapper" style = "width: 100%; height: auto; position: absolute; top: 100px; bottom: 0;" & Gt; & Lt; Div id = "left" style = "width: 250px; height: 100%; float: left;" & Gt; Left & lt; / Div & gt; & Lt; Div id = "right" style = "width: 250px; height: 100%; float: true;" & Gt; True & lt; / Div & gt; Main content & lt; / Div & gt; & Lt; / Div & gt; & Lt; / Body & gt;  

If I understand correctly, you want to float the right divs And have you left the wrapper div, but maintain the full height of the wrapper div in the screen?

If so, the right and left part goes inside the cover, and you {... float: left; Status: Relative;} and {... Float: Correct; Position: Relative;} To float them to the sides

Now, because you have planted these two devices which are part of the content of your wrapper div, It is that two divites are inside "float out of" If your cover is inside two divs in the same height, then you can:

  • Insert it inside your cover as a third div: and

    If on the other hand, you want All of your content always spreads to the full height of the screen, as long as you have done anything you need to do some CSS magic and it will be very complicated to understand without seeing your code. Start here:

    Hope that helps.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -