javascript - Shrink height of website to be mobile friendly -
i have website working on. before far (yes of links don't work because haven't made them yet) trying make sure fits on iphones , other mobile devices. height (css) works great on computer, extends far below intend when loaded on mobile device.
here script of index.html page:
html body { width: 100%; height: 100%; margin: 0%; padding: 0px; overflow: hidden; display: flex; background-image: url(http://www.jpegchaos.com/chipimage.jpg); background-repeat: no-repeat; background-size: cover; } #fullbody { margin: 0px; float: left; position: absolute; padding: 0px; width: 100%; height: 100%; display: flex; } #left { width: 15%; height: 100%; padding: 0px; margin: 0px; display: inline-block; opacity: 0; } #center { width: 70%; height: 100%; padding: 0px; margin: 0px; background-color: lightgrey; display: inline-block; } #centertextarea { width: 90%; height: 100%; padding: 0px; margin-right: 5%; margin-left: 5%; margin-top: 0px; text-wrap: normal; word-wrap: break-word; } #right { width: 15%; height: 100%; padding: 0px; margin: 0px; display: inline-block; } .header { font-size: 40px; color: black; text-align: center; } .footer{ background-color: lightgrey; font-size: 13px; color: black; text-align: center; bottom: -60px; height: 100px; left: 0; position: absolute; width: 60%; margin-left: 20%; }
then html
<!doctype html> <html> <head> <meta name=viewport content='width=700'> <title>jpeg & chaos llp - technology repair hq</title> <link rel="stylesheet" href="styles/structure.css"> <link rel="stylesheet" href="styles/advanced.css"> <link rel="stylesheet" href="styles/tags.css"> <link rel="icon" type="image/png" href="https://fbcdn-profile-a.akamaihd.net/hprofile-ak-xpf1/v/t1.0-1/c27.0.160.160/p160x160/541649_1552490621690166_7622307717201533155_n.jpg?oh=0be92daed3243de2719efe5185583bc1&oe=55d3880b&__gda__=1437242841_f81d654a074a10e951f604fd343220c9"> <script src="//code.jquery.com/jquery-1.10.2.js"></script> <script> $(function () { $("#top").load("structure/header.html"); $("#bottom").load("structure/footer.html"); $("#menubar").load("structure/menubar.html"); $("#newssidebar").load("news.html"); }); </script> </head> <body> <div id="fullbody"> <div id="left"></div> <div id="center"> <div id="top"></div> <div id="menubar"></div> <div id="centertextarea"> <table class="noborder"> <tr class="noborder"> <td class="splitleft"> <!-- removed clerity --> </td> <td class="hollowmiddle"></td> <td class="splitright"> <!-- removed clerity --> </td> </tr> </table> </div> <div id="bottom"></div> </div> <div id="right"> <div id="newssidebar"></div> </div> </div> </body> </html>
the frames , load perfectly, center 1 seems go way far.
i took out "footer" div , it's still tall, excluding possibility list.
throught many changes, , comments received did following fix this:
*removed height function #right
div
*changed #left
div height: 1px;
*changed #center
div height: 100vh
*added overflow-y: auto;
#center
div
*changed #footer
to:
.footer{ background-color: lightgrey; font-size: 13px; color: black; text-align: center; position: absolute; bottom: 0; left: 0; width: 70%; margin-left: 15%; white-space: nowrap; }
Comments
Post a Comment