Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

Laura Hill
Laura Hill
13,674 Points

just tested my site on browserstack and it looks horrible in most browsers and media queries arent working in any!! YAY!

Would anyone have a look at my code and tell me why they think my media query isnt working.

Site looks great in Mavericks/Chrome 39 and one other but most were way off.

The one radial and two linear gradients are there but very, very, dark. Thanks.

Laura Hill
Laura Hill
13,674 Points

sorry the site is live and the url is

www.advocatevbps.com

Can you post your CSS file with media queries?

I'm using Mozilla Firefox and your site looks fine to me! The only problem is when I start scaling the browser down then things start to break. I've had this problem before when I built a page in full browser then tried to adapt it to mobile screen size using media queries. Now I always build a page Mobile size first then work my way up with media queries. Heaps easier!

9 Answers

Laura Hill
Laura Hill
13,674 Points

Hi Russell, Thank you - I am using Dreamweaver (and paying monthly for Creative Cloud) so the mobile-first issue should not be a problem for me - but it is!! I have constantly checked the phone and tablet version of my site while I was building it and they look great in dreamweaver and work properly when I open the local docs on my browser. The media query isnt working on the hosted site now that I have transferred the files via FTP. What could I be missing?

Laura Hill
Laura Hill
13,674 Points

Hi Alberto, Here is my media query:

@media (max-width: 769px) {

.main-wrapper {
    background: none;
    width: 90%;
    }

.main-logo,
.main-nav,
.main-nav li  {
    display: block;
    width: initial;
    margin: initial;
    }
.main-logo {
    margin-right: auto;
    margin-left: auto;
    }   
.main-logo {
    display: 90%;
    }
.main-nav {
    margin-right: 10px;
    margin-left: 10px;
    padding-left: initial;
    float: none;
    }
    #nav-buttons {
    font-size: 1.5rem;
    }       
.main-nav li {
    margin-top: 15px;
    }       
.main-banner {
    display: none;
    }   
.primary-content {
    width: 100%;
    text-align: center;
    font-size: 1rem;
    border-right-style: none;
    }
.secondary-content {
    display: none;
    }

.ftrimg {
    max-width: 50px;    
    }           

}

What did you type for your media query?

Laura Hill
Laura Hill
13,674 Points

just formatted it properly and posted above thank you for looking at it with me

I've never used Dreamweaver so I might not be the best person to help out with this one. But from what I can see from your media query is that you've only got one (maxwidth: 769px)... so every browser size smaller than 769px is going off that one media query. I would suggest adding more media queries at smaller scales ( like maxwidth: 500px, 300px, etc) where you adjust the size of all your content to fit each media query specifically. Hopefully that makes sense :p

I think you shuold try with a better responsive layout. Try to fix images with a % dimension , buiilding up two section for your colums and then build a new media query that make your site fill in one single column if the screen is too small, two if the screen is fine. If u need an help to do this just ask, but with the basic tutorial there shuold be all explaned in 4 minutes!

https://teamtreehouse.com/library/how-to-make-a-website/responsive-web-design-and-testing/build-a-three-column-layout

Laura Hill
Laura Hill
13,674 Points

Hi Alberto, my one media query does this. I may be confused about something but in dreamweaver (and now I see it in Chrome) I really like my mobile design. I just cannot get it to render nicely across all browsers. I may be having trouble with hex colors or gradient capabilities because the site is very dark and unreadable in many browsers but bright, pretty and clear in others. I think I need some web-kit prefixes specific to browsers, maybe? Or do I need to lose color keywords like "Lightgrey" and go with a straight up hex code, or switch to RGB. I dont know:((

Laura Hill
Laura Hill
13,674 Points

Hey guys, Would you please have a look at my site today and resize as well? Please let me know of you see any improvement. Otherwise Im back to the media query vids! Thank you!

Now is really really better! The only problem i have is about the image in the header. I see it going out of the page! The others elements of the site looks great!

Laura Hill
Laura Hill
13,674 Points

Thank you. It's a completely new mobile version now. I agree about the header image. It's bad because the text is in he image and not readable by search engines or screen readers. I thought it was so cute though. I have to figure out a way to make the text readable, or just get rid of it. Thanks again!

Your welcome! Is nice to be usefull ^^

Bye!