?
Solved

Responsive Styling

Posted on 2015-01-15
4
Medium Priority
?
105 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 2000 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
Suggested Courses

752 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