-
AuthorPosts
-
April 13, 2018 at 5:17 pm #941607
Hello,
I don’t manage to get the color section background image responsive.
On the Confiance page (credentials below), I have this image https://avecvous.co/wp-content/uploads/2018/04/bandeau_violet_1920.jpg. You can see 5 colours on the top border. I’d like those 5 colors to be displayed whatever the desktop / tablet screen size is.On my 1920 * 1080 computer, I only see 4 colors.
How can I do to get this bg image responsive?Tx a lot guys for your help,
Nice WE
MarineApril 15, 2018 at 9:20 pm #942292Hey newki75,
Unfortunately there is no way to do that, only if you replace the image with a smaller one on mobile ( the same image, but resized down so the lines can be shown properly ).
If you make the image again for us, we can provide CSS to replace it.Best regards,
BasilisApril 16, 2018 at 9:17 am #942474Hey Basilis,
My question was just for desktop / tablets. Using Background-size: cover doesn”t allow me to get the real image size whatever the screen resoluton is?
Tx,
Nice day
MarineApril 17, 2018 at 7:27 pm #943231Hi,
As Basilis mentioned, a good option would be to design a properly sized image so the full image can be realized at each break point. If this is only for tablet and desktops then you would only need to update the image size for those resolutions.
Best regards,
Jordan ShannonApril 18, 2018 at 9:01 am #943496Hello Jordan,
I’ve found a solution : background-size: cover. It displays my image full width :-)
And I remove the image for mobile.
Tx, you can close the case
MarineApril 18, 2018 at 10:55 am #943526let it shortly open :
you can give a container more than one background-imageyou can have here a look to what is possible ( it works with color-section too) : https://webers-testseite.de/multiple-background-images/
so you can do it via css to have the whole color-section a gradient and on top ( no-repeat) your 5-colored small line ( without the violett on the bottom) and set this image to contain !
I will give you a demonstration: https://webers-testseite.de/multiple-background-images/
on the bottom there is your color-section – if you shrink the window size you see that the small image with the colored fields is responsive and not cut of all color fields are seen !
the gradient is the other thing as described in the test page.
code for that colorsection (got id = confiance)#confiance { background-image: url(/wp-content/uploads/bandeau_1920.jpg ) , -webkit-linear-gradient(left, rgb(88,87,90) 0%, rgb(110,99,140) 100%); !important; background-image: url(/wp-content/uploads/bandeau_1920.jpg ) , linear-gradient(to right, rgb(88,87,90) 0%, rgb(110,99,140) 100%) !important; background-repeat: no-repeat; background-position: left top, center center; background-size: contain, cover ; }
or even better to have for that image a width of 100% and a static height:
#confiance { background-image: url(/wp-content/uploads/bandeau_1920.jpg ) , -webkit-linear-gradient(left, rgb(88,87,90) 0%, rgb(110,99,140) 100%); background-image: url(/wp-content/uploads/bandeau_1920.jpg ) , linear-gradient(to right, rgb(88,87,90) 0%, rgb(110,99,140) 100%) !important; background-repeat: no-repeat; background-position: left top, center center; background-size: 100% 20px, cover; }
April 18, 2018 at 11:30 am #943544So for your pages you only have to edit the gradient – the image on top is the same
here is a nice gradient creator online: http://www.cssportal.com/css-gradient-generator/
you only need two definitions the webkit and the normal one ( they are enough for all modern browsers)if you have that background more than once – maybe you give it better a custom class
April 18, 2018 at 5:26 pm #943679Hey newki75,
I’m glad you were able to find a solution for this. If you need further help please let us know here in the forums.
Best regards,
Jordan Shannon -
AuthorPosts
- The topic ‘Color section background image’ is closed to new replies.