Make background image responsive

http://clinica-americas.com/about.html

The client wants to see the whole header on mobile, rather than just the logo. He doesn't care that it will be very small.
.wrapper{background:url(../images/header1.jpg) left top no-repeat;}

That's where it is, is there a way to make the whole image appear?

Thanks.
mel200Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Tom BeckCommented:
You can try playing with the background-size of the header image combined with media queries.

To do that you will have to first go to your styles.css file and change the shorthand definition for ".wrapper" to a longhand to isolate the background-size setting.
From this:
.wrapper{background:url(../images/header1.jpg) left top no-repeat;}

Open in new window

To this:
.wrapper{
	background-image:url(../img/header1.jpg);
        background-repeat:no-repeat;
	background-position:top left;
	background-color:#000;
}

Open in new window

Then add some media queries. Adjust the percentages and min max values to your liking.
@media only screen and (max-width:940px) and (min-width:768px) {
	.wrapper {
		background-size: 250% 25%;
	}
}
@media only screen and (max-width:767px) and (min-width:530px) {
	.wrapper {
		background-size: 200% 25%;
	}
}
@media only screen and (max-width:529px) {
	.wrapper {
		background-size: 200% 18%;
	}
}

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mel200Author Commented:
OK, thanks, I hadn't thought of that.
0
mel200Author Commented:
Ok, this is actually fun. I think I have the mobile size right. But when I play with the tablet size, I get no changes, even when I make it the same as the mobile size:

@media only screen and (max-width:940px) and (min-width:768px) {
      .wrapper {
            background-size: 250% 25%;
      }
}
@media only screen and (max-width:767px) and (min-width:530px) {
      .wrapper {
            background-size: 145% 14%;
      }
}
@media only screen and (max-width:529px) {
      .wrapper {
            background-size: 145% 14%;
      }
}

Any thoughts on that? Thanks!
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Tom BeckCommented:
The changes are definitely being applied at iPad size. Here's a screen capture (Firefox) at 758px width. You need to adjust the height of the background image until the black line disappears at every size.
758px wide screen capture
0
mel200Author Commented:
0
Tom BeckCommented:
I can't explain that. Could be cached versions. Regardless, it's happening on desktop browsers and that's reason enough to get it adjusted.
0
mel200Author Commented:
Great solution, thanks!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.