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 CSS Layout Basics Positioning Page Content Fixed Positioning

adding width: 100% did not change .main-header.

The .main-header still doesnt stretch the width of the viewport: Im using the css from the flexbox tutorial not the css from css layout basics.

@media (min-width: 769px) {
    .main-header,
    .main-content {
        width: 80%;
        margin: 0 auto;
    }

    .main-header{
        position: fixed;
        background: #fff;
        box-shadow: 0 1px 4px rgba(0,0,0, .4);
        width: 100%;
        top: 0;
    } 

    body{
        padding-top: 70px;
    }

    .tagline {
        font-size: 1.4em;
    }
}

@media (min-width: 1025px) {
    .main-header,
    .main-content {
        width: 90%;
        max-width: 1200px;
    }


}
Kevin Gates
Kevin Gates
15,053 Points

Can you share your HTML files as well?

Kevin Gates
Kevin Gates
15,053 Points

Also, your code above uses media queries. At what viewport width were you testing?

1 Answer

Thanks Kevin but I figured it out.