Solved

Responsive Styling

Posted on 2015-01-15
4
102 Views
Last Modified: 2015-01-15
I am updating code on a site that I inherited from another development team. There is one feature in the site that causes a background image to disappear once the screen size is reduced. I have gone through all the code and CSS and cannot figure out what they used to make this work. The section in question is #featured_area. Can anyone point me to the section of the code or the style in the CSS that is making this happen?

    <div id="featured_area" class="full_width">
    	<div class="page_wrapper">
		<div class="featured_title">
			<h1>Informed Patients Are Better Patients</h1><br>
			<p>Our Healthy Florida is designed to help patients navigate and understand the complex and confusing treatment options available today.</p>
		</div>
            <div class="featured_content">
            </div>
        </div>
    </div>

Open in new window


If you are following any of my other threads you will recognize this from the last problem I resolved. I have changed these pages but I need to solve this issue for yet another reason.
style.css
0
Comment
Question by:gacto
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 38

Expert Comment

by:Tom Beck
ID: 40552309
I have an advantage on this one because I'm already familiar with your site.

The css that causes the background image to disappear at 539px width is in responsive.css, line 39 (according to the developer tools), not style.css.

@media only screen and (max-width: 539px) {
    #featured_area {
        background: none repeat scroll 0 0 #fff;
    }
}
0
 
LVL 38

Accepted Solution

by:
Tom Beck earned 500 total points
ID: 40552338
In style.css add background-size: contain to the #featured_area css like we discussed, leave everything else as is, then in responsive.css change the definition for #featured_area in the media query for 539px to:

#featured_area {
    background-position: center 200px;
}

This will move the background image down so it's not overlapping the text.

Then for other media query widths, add the same css as above but adjust the 200px value as needed to position the background image where it looks best for that width.

With a little tweaking, you can have the background image scale properly for every screen width. That's responsive design!
0
 

Author Comment

by:gacto
ID: 40552370
Yep you have an advantage and you solved it on the first shot. I didn't even consider the responsive.css sheet. I was too focused on style.css.

Thanks again for the help and the quick response. Hopefully I won't have too many more ridiculous questions come up.
0
 
LVL 38

Expert Comment

by:Tom Beck
ID: 40552732
Ridiculous?? Not even close.

Thanks for the points.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question