CSS – make div’s inherit a height

As already mentioned this can’t be done with floats, they can’t inherit heights, they’re unaware of their siblings so for example the side two floats don’t know the height of the centre content, so they can’t inherit from anything. Usually inherited height has to come from either an element which has an explicit height or … Read more

CSS 100% height layout

You can do it with table style CSS properties, but still retain table less markup (which is still a win). Example HTML <div id=”container”> <div id=”header”><div>header</div></div> <div id=”content”><div>content</div></div> <div id=”footer”><div>footer</div></div> </div> CSS html, body { height: 100%; padding: 0; margin: 0; } #container { display: table; width: 100%; height: 100%; border: 1px solid red; text-align: … Read more

How to set Custom height for Widget in GridView in Flutter?

The key is the childAspectRatio. This value is use to determine the layout in GridView. In order to get the desired aspect you have to set it to the (itemWidth / itemHeight). The solution would be this: class MyHomePage extends StatefulWidget { MyHomePage({Key key, this.title}) : super(key: key); final String title; @override _MyHomePageState createState() => … Read more

Mobile Safari $(window).height() URL bar discrepancy

Tldr If you just want to query the window height, cross-browser, and be done with it, use jQuery.documentSize and call $.windowHeight(). For implementing your own solution, read on. When to use jQuery or the clientHeight of the document jQuery’s $(window).height() is a wrapper for document.documentElement.clientHeight. It gives you the height of the viewport, excluding the … Read more

How might I force a floating DIV to match the height of another floating DIV?

Wrap them in a containing div with the background color applied to it, and have a clearing div after the ‘columns’. <div style=”background-color: yellow;”> <div style=”float: left;width: 65%;”>column a</div> <div style=”float: right;width: 35%;”>column b</div> <div style=”clear: both;”></div> </div> Updated to address some comments and my own thoughts: This method works because its essentially a simplification … Read more