-
AuthorPosts
-
September 2, 2016 at 5:06 pm #681396
Hey,
I’m using a color section in my webpage with an image in the background (watercolour green paint). I would like this image was responsive, so when the page is seen on devices the image reduce proportionally. How can I achieve this?
Thanks,
EduSeptember 4, 2016 at 7:56 am #681743Hi edupuntoes,
It looks good on my end, could you try to explain a bit further what you are looking to achieve please?
Best regards,
RikardSeptember 4, 2016 at 11:38 am #681770Hi Rikard,
I’m trying to decrease the size of the watercolor paint image when I see it on the phone screen to adapt to a small screen dimensions. Right now when I see this webpage on my phone screen the size of that image is huge and almost fill the whole screen, I want to decrease the size of this image proportionally when I see on my phone screen. Do it responsive.
I don’t know if I can explain well. Please let me know if you know further information.
Best,
EduSeptember 4, 2016 at 1:36 pm #681781Well your background image you have to know the aspect ratio. If you know that you can try to obtain your desired look by calculating the hight.
First: do not set in the color-section dialog a min-height !
Set your background image to “scale to fit”
on my test page (page-id is 2981 here) the aspect ratio of the image is 350px : 1500px
that means image-height is nearby 23.5% of the image-widththe css rule than is:
.page-id-2981 .avia-full-contain { background-size: 100vw; height: 23.5vw; }
See example here: http://webers-testseite.de/ikom/circles/
You have to set some media-querry solutions for the content of that color-section
vw and vh are video-screen width and height ! viewport units are good supported now: Link
but to make it specific and not for all either you give the color-section a unique ID or custom class or (see above) do that only for that page.
if you got an overlay color – you have to set the same parameters to that class:
.home .avia-full-contain, .home .av-section-color-overlay-wrap { background-size: 100vw; height: calc(66.7vw); }
see here: http://webers-testseite.de/ikom/
but you see this works for simple layouts – on that start page there is an overlapping container following etc. pp. in that case there has to be more adjustments to make- This reply was modified 8 years, 2 months ago by Guenni007.
September 4, 2016 at 2:30 pm #681794btw: on that home page above the start page with an aspect ration of 66,7% is ugly.
on common screens with 16:9 ( the aspect ratio is 56.2%) everything over this ratio is not so nice!
So best is to use suitable background-images with a “panorama-look” with aspect-ratios under 56%September 4, 2016 at 7:16 pm #681833Hi!
Once again @Guenni007 has nailed it with his reply.
Please do follow his steps and if there is an issue, let us know and we will see how we can help further.Thanks a lot for your understanding and patience
Cheers!
BasilisSeptember 5, 2016 at 11:54 am #682083oh sorry i see above that i have used one time the calc instruction. This is not necessary. Just use hight: 66.7vw – and so on.
September 5, 2016 at 11:59 am #682084Hi Guenni and Basilis,
Thank you very much for your incredible help! It’s the first time that I hear about viewport units. I will proceed as you suggest. I will let you know if I have some trouble.
Many Thanks!!
September 6, 2016 at 6:54 am #682471 -
AuthorPosts
- You must be logged in to reply to this topic.