Durden Posted September 20, 2016 Share Posted September 20, 2016 Hi, I've been looking around for it but couldn't find an answer. I scale my game with SHOW_ALL, but I have a 25px navbar on top of my screen using absolute positioning, so the top of the game is hidden under the bar. I put an empty div with a 25px margin-top in my page body to fix that, and now the navbar and the game don't overlap each other anymore, but the game keeps the same size instead of resizing to (screen height - 25px) so the full game doesn't appear anymore on screen, I have to scroll down 25px to see the bottom. Is there a way to scale the game to ( SHOW_ALL - '25px in height' ) ? I don't want to have a vertical scrollbar at all. Link to comment Share on other sites More sharing options...
samme Posted September 20, 2016 Share Posted September 20, 2016 Hi Durden, here is one way: http://codepen.io/anon/pen/qaqqoX?editors=0100 html, body { height: 100%; } body { position: relative; margin: 0; padding: 0; background: #111; color: #eee; } /* html > body > #parent */ #parent { position: absolute; width: 100%; top: 25px; bottom: 0; } Link to comment Share on other sites More sharing options...
Durden Posted September 21, 2016 Author Share Posted September 21, 2016 Thanks a lot ! It works fine on my desktop, as well as on mobile, but for some reason it doesn't on my laptop (game sticks to the top of the screen below the navbar, even though it has every needed CSS values active). Sometimes the website is slow to update though, even when I wipe the cache multiple times, so hopefully it'll end up working fine in a couple of hours on my laptop as well. EDIT: alright it's perfect now, works everywhere. Thanks again ! Link to comment Share on other sites More sharing options...
Recommended Posts