[Snippet] CSS3 Keep ratio for background

Modifications for phpBB3.
Try the Mods here and share Your own Mods
Forum rules
You dont have to use ModX or make your mod AutoMod compatible. A simple textfile is fine
But if you post Mods here You also have to give support

[Snippet] CSS3 Keep ratio for background

Post by FTH »

Author : FTH
Description : Keep the ratio (width/height) for background (only for browsers supported CSS3)

Example :

You want to add an image to your background on your board... Upload a large image (2560*1600 for my example)

Open file styles/prosilver/theme/colours.css

Find :

Code: Select all

html, body {
	color: #536482;
	background-color: #FFFFFF;
}
Replace with :

Code: Select all

html, body {
	color: #536482;
	background-color: #FFFFFF;
	background-size: cover;
	background-position: center center;
	background-image: url("{T_THEME_PATH}/images/your_image.jpg");
	background-repeat: no-repeat;
	background-attachment: fixed;
}
Change "your_image.jpg" by your image !!!