Make the website support smaller windows/resolutions -
Slice - 12.12.2011
tl;dr: CSS code that will slim down the website if your browser window is small.
Hey,
I barely ever have my browser window fill up even half the screen size. The SA-MP forum theme doesn't deal with that very well... So I fixed it!
Before:
After:
How-to
This CSS should work with any modern browser. You will need a plug-in to install custom CSS for websites. For Chrome, I used
Stylish and simply put "URL starting with:
http://forum.sa-mp.com".
You can alter the max-width on the first line to whichever suits you best. The forums will look normal if you have a wide browser window, otherwise you'll see a slimmed-down version.
The CSS:
Код:
@media screen and (max-width:1024px) {
body,
html {
margin: 0;
padding: 0;
background: #DADADB;
}
body > center {
display: none;
}
.page {
width: auto !important;
}
.page > div {
padding: 0 !important;
}
.page > div > br:nth-child(1) {
display: none;
}
.page > div > table:nth-child(2) {
border-top: none !important;
border-spacing: 0 !important;
}
body > div[align="center"] + form {
display: none;
}
}
Re: Make the website support smaller windows/resolutions -
Tarantula - 12.12.2011
Oh that code's messy. Lol.
Re: Make the website support smaller windows/resolutions -
Slice - 12.12.2011
It is?
Re: Make the website support smaller windows/resolutions -
Tarantula - 12.12.2011
Quote:
Originally Posted by Slice
It is?
|
To me it is.
Re: Make the website support smaller windows/resolutions -
Slice - 12.12.2011
Well, it's CSS.. Maybe you don't know what that is.
Re: Make the website support smaller windows/resolutions -
Tarantula - 12.12.2011
Quote:
Originally Posted by Slice
Well, it's CSS.. Maybe you don't know what that is.
|
Well, I actually do. But I was actually stating that I do it in a cleaner style, by sarcastically saying "That code is messy. Lol".
Re: Make the website support smaller windows/resolutions -
Slice - 12.12.2011
I figured that. I'm guessing you just learned CSS, and you spend half the time aligning colons? Good for you.
Re: Make the website support smaller windows/resolutions -
DirtyLilFreak - 12.12.2011
Quote:
Originally Posted by Tarantula
Oh that code's messy. Lol.
|
Assuming that you know CSS, how is this code messy? >.> I have a feeling you have no idea about CSS. The coding looks pretty clean.
Re: Make the website support smaller windows/resolutions -
Tarantula - 12.12.2011
Quote:
Originally Posted by Slice
I figured that. I'm guessing you just learned CSS, and you spend half the time aligning colons? Good for you.
|
Not just learned, known it for some time, I just force myself to clean it up.
Quote:
Originally Posted by DirtyLilFreak
Assuming that you know CSS, how is this code messy? >.> I have a feeling you have no idea about CSS. The coding looks pretty clean.
|
To me, its messy. I have an opinion on it. I know CSS, but I just align the colons because I like doing it. I have a sense of it being clean that way.
Re: Make the website support smaller windows/resolutions -
Bakr - 13.12.2011
Nicely done, I'll be sure to use this.
Quote:
Originally Posted by Tarantula
To me, its messy. I have an opinion on it. I know CSS, but I just align the colons because I like doing it. I have a sense of it being clean that way.
|
Doing that must makes it look uglier, to be honest.