- This topic has 9 replies, 2 voices, and was last updated 3 years, 11 months ago by
David.
-
AuthorPosts
-
April 6, 2019 at 1:19 am #861131
takkularapsis
Hi, i would like to get the header element background image to adapt in screen height and width. Do i need to use some slider plugin with shortcode or is there a way to do this with GP only without plugins like i have done?
April 6, 2019 at 4:28 am #861205David
StaffCustomer SupportHi there,
do you mean you want the image to always be 100% visible whatever the height / width of the browser is?
If so its not possible when using a Full Screen layout as the containers aspect ratio would differ from that of the image. Its also tricky to do this when the images isn’t set full screen but the Element has content. Let me know.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/April 7, 2019 at 1:45 am #861814takkularapsis
Hi,
It doesnt have to be full screen. I put it only full screen cause i tryid to get it work. I would like that the image height adapts to screen size. Like now i have 1080px high screen and image looks good. But if i check the page with smaller screen, like 900px high, the image goes over, and especially the arrow in the bottom of the image. Best option would be that the image would go 900px high also.
April 7, 2019 at 3:43 am #861860David
StaffCustomer SupportThe problem with trying to do this is the height will reduce in line with the browser width. Which would require the content to shrink considerably for it to fit in. Just to explain the issue add this CSS temporarily and make your browser width smaller:
.page-hero { background-size: contain !important; }
There’s quite a lot of variables to consider to get this to work.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/April 7, 2019 at 10:24 pm #862468takkularapsis
Thanks for your answer. The background image can overlap in width ( that doesnt mind cause the image is only abstract image at the background.) My worry is to get the background image bottom border to be always as high as browser hight. I have done this before with sliders like metaslider or revolution slider, but i wanted to consider this as a option, doing it without plugins.
April 8, 2019 at 2:35 am #862618David
StaffCustomer SupportOk – so full screen ? What was the issue when you had the header element set to full screen?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/April 9, 2019 at 1:12 am #863610takkularapsis
Thanks,
Full screen is the answer. And it works fine, IF i dont put my ( starting to hate :)) arrow-img in the bottom center of the element.
Now, what have i done is that i put margin-top: 270px to the img css, but it doesnt work when going to smaller screens. How would you do it?
Thanks again.
April 9, 2019 at 5:39 am #863807David
StaffCustomer SupportOK, so you can use this CSS to position it:
.page-hero { position: relative; } .page-hero a._mPS2id-h { position: absolute; bottom: 40px; left: 0; right: 0; padding: 0 100px; }
The padding is to make the ‘click’ zone wider than the arrow.
The bottom: 40px; keeps it 40px from the bottom of the screen, if you want to remove the space then change it0;
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/April 10, 2019 at 10:03 pm #865650takkularapsis
Awesome, cant thank you enough! Super support! 🙂
April 11, 2019 at 3:37 am #865883David
StaffCustomer SupportGlad to be of help.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/ -
AuthorPosts
- You must be logged in to reply to this topic.