Min-width causes an extra space vertically on Android screen in portrait mode in HTML/CSS -
recently, met issue android chrome browser, in portrait mode (in landscape looks fine) when using following html code , css code.
i use bootstrap framework
body { min-width: 900px; } #test div { max-height: 400px; overflow: auto; } #test table { margin-bottom: 0; } #test table tr td { width: 25%; padding-right: 5px; } #test table tr th { width: 25%; }
<div class="col-xs-12 col-sm-10 col-sm-offset-1" id="test"> <table class="table table-bordered"> <thead> <tr> <th>name</th> <th>size</th> <th>modification</th> <th>action</th> </tr> </thead> </table> <div> <table class="table table-bordered"> <tbody> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> <tr> <td>sdad asdadsasdas</td> <td>asdasdasdasd</td> <td>asdasd asd asd</td> <td>adsasd adsasdasd</td> </tr> </tbody> </table> </div> </div> <div class="clearfix"></div>
or better, jsfiddle document: http://jsfiddle.net/32lg9ddf/
now, please simulate in android device in portrait mode , you'll see appear space (height bigger not visible in inspect element in chrome) @ bottom of page when scrolling.
that's strange because on other devices ios , windows phone looks , no space (or bigger height) shown.
see screen recording see problem: http://i.imgur.com/q0oavt2.gif used remote debugging using nexus 7 tablet 7" screen.
what did wrong ?
how want display on smaller screen sizes 900px? can handle using responsive css media queries, there many examples online.
for example, when screensize 600 900px reduce font size or alter min-width
(and possibly increase max-height). can apply min-width
of 900px larger screen sizes , use width:auto
rest.
setting overflow property 'scroll' in css show horizontal scrollbar instead of space underneath, when screen size used small. overflow
set hidden cut out not fit without giving space underneath (if data fixed , fits in can use or reduce min-width size).
this can done adding css file:
body { overflow:scroll;}
this scroll horizontally and/or vertically. alternatively can apply table
tag.
responsive html examples, including bootstrap popular tool handling you. http://www.w3schools.com/html/html_responsive.asp
Comments
Post a Comment