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.
Melody ScottAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
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

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
Melody ScottAuthor Commented:
OK, thanks, I hadn't thought of that.
Melody ScottAuthor 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!
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

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
Melody ScottAuthor Commented:
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.
Melody ScottAuthor Commented:
Great solution, thanks!
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.