Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Flexform › Alt background not responsive for one image only
New Landing › How can we help? › Themeforest Theme Support › Flexform › Alt background not responsive for one image only
- This topic has 14 replies, 3 voices, and was last updated 9 years by David Martin – Support.
-
Posted in: Flexform
-
August 21, 2015 at 11:18 pm #206392
I created a test page that I’d like to use with a full width text box with alt background. The image for this alt background isn’t responsive at all. I tested other images on this test page and they are responsive. I’m not sure what the problem is.
Website info will be posted below.
August 21, 2015 at 11:22 pm #206393This reply has been marked as private.August 21, 2015 at 11:35 pm #206399I’ve solved the responsiveness, but when in smaller windows, there is a white space beneath the first alt background section.
August 22, 2015 at 12:53 am #206403Resolved by myself.
Solution if anyone is interested:
I solved the issue with a bunch of media queries for various sizes, selecting the class of the specific section and changing the height.For example:
@media only screen
and (min-width: 495px)
and (max-width: 767px){
.home-row-simple {
min-height: 250px;
}
}August 22, 2015 at 1:02 am #206404Actually, the issue is not resolved. On my phone, the white space is still there beneath the section.
August 24, 2015 at 5:17 pm #206885Hi,
That looks to be because of the custom CSS:
Can you amend it with this:
@media only screen and (max-width: 979px) @media only screen and (max-width: 768px) @media only screen and (max-width: 474px) and (min-width: 301px) .home-row-simple { min-height: 140px; }
Thanks,
David.August 24, 2015 at 7:25 pm #206927Hi David,
I just added that custom css and deleted the ones I wrote with media queries. The white space is still there. Can you check?
Thanks
August 24, 2015 at 7:48 pm #206936Update:
I used that code and also kept:
@media only screen and (max-width: 1024px) {
.alt-bg.alt-five {
background-image: url(“http://www.hillcapitalcorp.com/wp-content/uploads/2015/08/HCC-STR-Train.jpg”);
background-repeat: no-repeat;
background-position: center center;
background-size: cover;
}
}The white space is gone now, but the image does not scale responsively.
August 25, 2015 at 11:31 am #207155Hi,
You can use a different background image for that resolution, this way will also load a smaller image with maximum of 767px
Just replace the url below for the reduced image.
@media only screen and (max-width: 767px){ .alt-bg.alt-five { background-image: url("http://www.hillcapitalcorp.com/wp-content/uploads/2015/08/HCC-STR-Train.jpg"); } }
Hope it helps.
-Rui
August 27, 2015 at 6:21 pm #208239Hi Rui,
I used the new code you provided and added a smaller sized photo but its still not working. The image still doesn’t scale. Would it be possible if you or someone go into my website and fix it for me?
Thanks
August 28, 2015 at 11:19 am #208390Hi,
Remember to override your min-height and set the background size to cover for that. Working example:
@media only screen and (max-width: 767px) { .alt-bg.alt-five { background-image: url("http://www.hillcapitalcorp.com/wp-content/uploads/2015/08/HCC-STR-Train-8001.png"); background-size: cover; min-height: auto!important; } }
Thanks.
August 30, 2015 at 12:11 am #208655Ok, I updated with the new code. It works well on my desktop browser when I resize it, but with my phone, I can only see the word Transparent in the image and it is still large.
September 1, 2015 at 10:11 am #209065Hi,
The code provided is specifically for small screens, it works great for me on my iPhone6. What device version do you have?
Have you cleared your iPhone’s safari cache?
– David.
September 1, 2015 at 5:03 pm #209316Hi David,
I have an Android (Samsung S6). I’ve cleared cache but the image still doesn’t scale. I’ve attached an image of how it currently looks on my phone.
Attachments:
You must be logged in to view attached files.September 2, 2015 at 1:31 pm #209708Hi,
This seems specific to your device, as I do not have this device it’s very hard for me to test it.
My last thought is to target your devices screen dpi, can you add this and clear your device cache also.
@media (min-resolution: 577dpi) { /* Samsung S6 */ .alt-bg.alt-five { background-image: url("http://www.hillcapitalcorp.com/wp-content/uploads/2015/08/HCC-STR-Train-8001.png"); background-size: cover; min-height: auto!important; } }
Thanks.
-
Posted in: Flexform
You must be logged in and have valid license to reply to this topic.