Make the website support smaller windows/resolutions
#1

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;
	}
}
Reply
#2

Oh that code's messy. Lol.
Reply
#3

It is?
Reply
#4

Quote:
Originally Posted by Slice
Посмотреть сообщение
It is?
To me it is.
Reply
#5

Well, it's CSS.. Maybe you don't know what that is.
Reply
#6

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".
Reply
#7

I figured that. I'm guessing you just learned CSS, and you spend half the time aligning colons? Good for you.
Reply
#8

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.
Reply
#9

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.
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)