Responsive background for header only
-
I am using the Responsive theme. I want to set a full-width responsive background image for the header area only. I have managed to get the image positioned and responsive, but the CSS height parameter is still giving me trouble. If I don’t set a height, the header cuts off the image at the logo height. If I set the fixed height of the image at full width, on mobile viewing the content is pushed way down the screen.
See https://akashastudiojp.com/wp for the work-in-progress
Here’s my CSS (all in a child theme):
body.home #header img { width: 100%; max-width: 100%;} body.home #header { z-index: 0; background: url(https://www.akashastudiojp.com/wp/wp-content/uploads/2013/10/background-1.png) no-repeat; background-size: 100%; background-position:center; width: 100%; max-width: 100%; height: 920px; min-height: 215px;}
I know height and min-height conflict with each other, but I wish they could run concurrently. Or max-height and min-height at the same time, to govern desktop viewers and phone viewers.
- The topic ‘Responsive background for header only’ is closed to new replies.