• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

AAC Don't strech website when resizing window

ralke

(҂ ͠❛ ෴ ͡❛)ᕤ
Joined
Dec 17, 2011
Messages
1,513
Solutions
27
Reaction score
866
Location
Santiago - Chile
GitHub
ralke23
Twitch
ralke23
Hi! I need some help with this. When I resize my website window, it makes the navigation bars align down, and screws the layout.
This is what I mean (is specially annoying when entering to website with phone):
1.png

I would like to know how to fix it, this is how it normally looks
2.png

I want that the website doesn't strech, just hide the part that is not shown, hope this image explain this well:
3.png

Here's my style.css

Regards!
 
Diff:
body
{
  background: url(img/bg.png) no-repeat center top #191611;
  margin: 0;
  padding: 0;
  font-size: 13px;
  font-family: Tahoma,Verdana,Segoe,sans-serif;
  color: #000000;
  position: relative; /* usually the parent, in this case the body element, has position relative so that the absolute positioned child is positioned relative to it */
  height: 100vh; /* 100% of the viewport height */
  margin: 0; /* recommended */
++min-width:800px;
}
you can play with min-width if you'd like, but you might also have some media queries changing stuff as well, try looking for another css file
 
@Rombadr thanks a lot for responding :) Applied the change but doesn't seems to change, reloaded the website with CTRL + F5 to reload cache. If there's other options please let me know and i'll try them. Regards!
 
If there's an online version I could look at, it'd be pretty helpful

Sure Greed Online (http://greedot.net/) Just tried something and switched position: relative; to absolute; to do the trick. It still restrech the background image, but is much better than before ;p

This is what I mean
ezgif-6-2558215f713b.gif


How can I make it work with static background?
It seems that center value should be replaced on the line below, but with what?

Code:
background: url(img/bg.png) no-repeat center top #191611;
 
Last edited:
Your current main body is this:
HTML:
<div class="top-bar"></div>
<div class="container_main"></div>
<div class="container_mid"></div>
<div class="container_right"></div>
<div class="footer_cnt"></div>

So do something like this:
HTML:
<div class="main">
    <div class="top-bar"></div>
    <div class="container_main"></div>
    <div class="container_mid"></div>
    <div class="container_right"></div>
    <div class="footer_cnt"></div>
</div>

and your css for main would be:
CSS:
.main{
    width:1170px;
    margin:0 auto;
}
 
Back
Top