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 How to Make a Website Responsive Web Design and Testing Adjust the Profile Page and Header

Ray Kennedy
PLUS
Ray Kennedy
Courses Plus Student 2,982 Points

floating logo to the left makes nav bar moves up slightly and the logo is also a bit high

i'm watching the video for adjusting the header and nav. When I float the logo left and the nav right they both are higher than in the video like something is pushing on them

my responsive css code:

/* @media means its targeting digital as opposed to print*/
@media screen and (min-width: 480px) {
    /**********************************
    TWO COLUMN LAYOUT
    ***********************************/

    #primary {

        width: 50%;
        float: left;
    }

    #secondary {
        width: 40%;
        float: right;
    }


    /**********************************
    3 * 5 = 15
    100 - 15% = 83%
    85 / 3 = 28.33333....
    ***********************************/



    /**********************************
    PAGE PORTFOLIO
    ***********************************/

    #gallery li {
        width: 28.3333%;
    }

    /* fixes weird spacing issue */
    #gallery li:nth-child(4n) {
        clear: left;
    }

    /**********************************
    PAGE: ABOUT
    ***********************************/

    .profile{
        float: left;
        margin: 0 5% 80px 0;
    }


}


@media screen and (min-width: 660px){

    /**********************************
    HEADER
    ***********************************/

    nav {

        /* removed background so text can sit against the header background*/
        background: none;

        float: right;
        font-size: 1.125em;
        margin-right: 5%;
        text-align: right;
        width: 45%;
    }

    #logo {
        float: left;
        margin-left: 5%;
        text-align: left;
        width: 45%;
    }

}

my main css code:

/**********************************
GENERAL
***********************************/

body {
    font-famil: 'Open Sans', sans-serif;
}


#wrapper {
    max-width: 940px;
    margin: 0 auto;
    padding: 0 5%;

}

a {
    text-decoration: none;
}

/* tells the image to fill their parent container */
img {
    max-width: 100%;
}

h3 {
    margin: 0 0 1em 0;
}

/**********************************
HEADING
***********************************/

header {
    float: left;
    margin: 0 0 30px 0;
    padding:5px 0 0 0;
    /* needs an explicit width because it's floated */
    width: 100%;
}


#logo {
    text-align: center;
    margin: 0;
}

h1 {
    font-family: 'Changa One', sans-serif;
    margin: 15px 0;
    font-size: 1.75em;
    font-weight: normal;
    line-height: 0.8em;

}


h2 {
    font-size: 0.75em;
    margin: -5px 0 0;
    font-weight: normal;
}

#contact {
    color: red;
    margin:0;
    padding:0;
}

#about{
    color: #000000;
    margin:0;
    padding:0;
}

/**********************************
NAVIGATION
***********************************/

nav {
    text-align: center;
    padding: 10px 0;
    margin: 20px 0 0;
}

nav ul {
    list-style: none;
    margin:0 10px;
    padding: 0;
}

nav li {
    /* puts our list items in a row */
    display: inline-block;
}

nav a{
    font-weight: 800;
    padding: 15px 10px;
}




/**********************************
FOOTER
***********************************/

footer{
    font-size: 0.75em;
    text-align: center;
    padding-top: 50px;
    color: #ccc;
    clear: both;
}

.social{
    width: 20px;
    height: 20px;
    margin: 0 5px;
}


/**********************************
PAGE: PORTFOLIO
***********************************/

#gallery {
    margin:0;
    padding: 0;
    list-style: none;
}
/* I was missing li causing an error */
#gallery li {
    float: left;
    width: 45%;
    margin: 2.5%;
    background-color: #f5f5f5;
    color: #bdc3c7;
}

#gallery li a p {
    margin:0;
    padding:5%;
    font-size:0.75em;
    color: #bdc3c7;
}



/**********************************
PAGE: ABOUT
***********************************/

.profile{
    display: block;
    max-width: 250px;
    margin: 0 auto 30px;
    border-radius: 100px;
}




/**********************************
PAGE: CONTACT
***********************************/

.contact-info{
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.9em;
}


/* this corrects the jumbled look it had */
.contact-info a {
    display: block;
    min-height: 20px;
    background-repeat: no-repeat ;
    background-size:20px 20px;
    padding: 0 0 0 30px;
    margin: 0 0 10px;



}


.contact-info li.phone a {
    background-image: url('../image/phone.png');
}

.contact-info li.mail a {
    background-image: url('../image/mail.png');
}

.contact-info li.twitter a {
    background-image: url('../image/twitter.png');
}

.mail{

}

.twitter{

}





/**********************************
COLORS
***********************************/

/* site body */
body {
    background-color: #fff;
    color: #999;
}


/* green header */
header {
    background: #6ab47b;
    border-color: #599a68;
}

/* nav background on mobile */
nav {
    background: #599a68;
}


/* logo text */
h1, h2 {
    color: #fff;
}

/* links */
a {
    color: #6ab47b;
}



/* nav link */
nav a, nav a:visited {
    color: #fff;
}

/* selected nav link */
nav a.selected, nav a:hover {
    color: #32673f;
}

my master layout:

<!doctype html>

<html lang="en">
    <head>
        <title>Kennedy | Designer</title>





        <!-- this has to come before my app.css or it wont work-->
        <link href="{{ asset('css/main.css') }}" rel="stylesheet" type="text/css" >

        <!-- must be in the middle -->
        <link href='http://fonts.googleapis.com/css?family=Changa+One|Open+Sans:400italic,
        700italic,400,700,800' rel='stylesheet' type='text/css'>

        <!-- Normalized file CSS -->
        <link href="{{ asset('css/normalize.css') }}" rel="stylesheet" type="text/css" >

        <!-- Responsive file CSS made this last -->
        <link href="{{ asset('css/responsive.css') }}" rel="stylesheet" type="text/css" >





        <meta charset=“UTF-8”>
        <meta name="viewport" content="width=device-width, initial-scale=1">



        <!-- jQuery library -->
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

        <!-- Latest compiled JavaScript -->
        <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
    </head>

    <body>

        <header>
            <a href="{{ action('HomeController@index')   }}" id="logo">
                <h1>Kennedy</h1>
                <h2>Designer</h2>
            </a>

            <nav>
                <ul>
                    <li><a href="{{ action('HomeController@index')   }}" class="selected">HOME</a></li>
                    <li><a href="{{ action('AboutController@index')  }}" >ABOUT</a></li>
                    <li><a href="{{ action('ContactController@index')}}" >CONTACT</a></li>
                </ul>
            </nav>
        </header>

        <div id="wrapper">


                @yield('content')


            <footer>
                <!-- add class to pic like this: ", array('class' => 'social')" -->
                <a href="#" class="social">{!! Html::image('image/twitter-wrap.png', 'Facebook logo', array('class' => 'social')) !!}</a>
                <a href="#" class="social">{!! Html::image('image/facebook-wrap.png', 'Twitter logo', array('class' => 'social')) !!}</a>
                <p>&copy; 2014 Kennedy.</p>
            </footer>

        </div>

    </body>
</html>

my home layout:

@extends('layouts.master')

@section('content')

        <ul id="gallery">
            <li>
            <a href="/image/numbers-01.jpg">
                    {!! Html::image('image/numbers-01.jpg', 'TODOParrot logo') !!}
                    <p>Experimentation with color and texture</p>
                </a>
            </li>
            <li>
                <a href="/image/numbers-02.jpg">
                    {!! Html::image('image/numbers-02.jpg', 'TODOParrot logo') !!}
                    <p>Playing with blending modes in photoshop</p>
                </a>
            </li>
            <li>
                <a href="/image/numbers-06.jpg">
                    {!! Html::image('image/numbers-06.jpg', 'TODOParrot logo') !!}
                    <p>trying to create an 80's style of glows</p>
                </a>
            </li>
            <li>
                <a href="/image/numbers-09.jpg">
                    {!! Html::image('image/numbers-09.jpg', 'TODOParrot logo') !!}
                    <p>drips created using photoshop brushes</p>
                </a>
            </li>
            <li>
                <a href="/image/numbers-12.jpg">
                    {!! Html::image('image/numbers-12.jpg', 'TODOParrot logo') !!}
                    <p>Creating shapes using repetition</p>
                </a>
            </li>
        </ul>

@stop

im using laravel 5 but I've been told it doesn't matter and things have been working until now

2 Answers

So I can see one minor error in your main.css code:

/**********************************
GENERAL
***********************************/

body {
    font-famil: 'Open Sans', sans-serif;
}

It should be font-family.

Otherwise, try post a link to a screenshot (upload to imgur or similar) so we can see what you mean.

Jared Hensley
Jared Hensley
8,106 Points

I have the same problem, did you ever figure this out? Same code and all, very odd.