Responsive module background?

Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Mon Jan 20, 2014 2:43 pm
Reply with quote
Report this post
Hello,
I followed few threads to find the way to set an image as background for an html module in the one-page configuration and this is what I wrote in override.css to get it:

#gkBottom1-2 {background: url('path-to-the-image') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}

This works perfectly: the image is centered and strecthes to fill the screen width if the screen is wider than the image, it doesn't if the screen is smaller. To better explain: visualization is just perfect on any laptop and desktop monitor, but on smartphones (and I guess also on tablets, even if I did not check) I can see just a part of the background image, losing the effect I was trying to get.

Do you know if there's a way to achieve a total responsiveness of the background image?

Thank you very much

Matteo
User avatar
Senior Boarder

GK User
Thu Jan 23, 2014 12:31 am
Reply with quote
Report this post
hi,
I suggest on smartphone use only color background - no images, less means better.

If you will add URL I can check on smartphone & tablet
User avatar
Platinum Boarder

GK User
Fri Jan 24, 2014 4:40 pm
Reply with quote
Report this post
Thank you Pawel,
does this means that there's no way to achieve that?
;)
In this case, could you please drive me to set different backgrounds for desktop/laptop and mobiles?
Check the beta version of the website at www.europeisanarchipelago.com

Thank you very much

M
User avatar
Senior Boarder

GK User
Sat Jan 25, 2014 12:13 pm
Reply with quote
Report this post
You can try to replace "cover" into "contain" -- inside background - this should help for BG images inside sections.
User avatar
Platinum Boarder

GK User
Mon Jan 27, 2014 2:46 pm
Reply with quote
Report this post
Hi Pawel,
using "contain" did not help. Or maybe did...I don't know exactly...I try to explain:

I was using two different images as background test in two different modules, one was a right dimensioned image (that I would have liked to used), the second was simply the joomla_black.gif system image. Both of them were having the same behaviour: strecthing to fit screen in desktop version and keeping "too large" on mobiles.
While I changed "cover" to"contain" the big one (http://www.europeisanarchipelago.com/#gkBottom1-2) does not strecth anymore to fit the screen in desktop and disappear completely on mobiles, the joomla_black.gif (http://www.europeisanarchipelago.com/#gkBottom1-3) is perfectly working...any idea of the reason why?

Thank you very much.

M
User avatar
Senior Boarder

GK User
Wed Jan 29, 2014 1:13 pm
Reply with quote
Report this post
The only solution I see is use different BG image for different views - mobile, tablet and desktop.
templates\gk_creativity\css\mobile.css
templates\gk_creativity\css\tablet.css
templates\gk_creativity\css\small.tablet.css

check those @media only screen and (max-width: ....px) { } new features of CSS
User avatar
Platinum Boarder

GK User
Sun Feb 02, 2014 7:46 pm
Reply with quote
Report this post
Thank you Pawel,

I'll work on it.

M
User avatar
Senior Boarder


cron