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

Simon Strömberg
Simon Strömberg
1,423 Points

[SOLVED] ,Menus or header is not floating to right & left...

I have done exactly the same, and i even downloaded the files from the video and used those files, but still menus wont float to right and logo wont float to left.. WHY ?

Wayne Priestley
Wayne Priestley
19,579 Points

Hi Simon,

We can't really tell until we see your code.

Here is a link to explain how to use Markdown to post your code How to post code

If you look at the bottom of the box when your typing a reply you will see Markdown Cheatsheet that will also explain how to post your code.

5 Answers

Simon Strömberg
Simon Strömberg
1,423 Points
<!DOCTYPE html>

<html>
 <head>
  <meta charset="utf-8">
  <title>Hemsida</title>
<link rel="stylesheet" href="css/normalize.css">
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700,800' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/responsive.css">
 </head>
 <body>
  <header>
<a href="index.html" id="logo">
    <h1>Rubrik1</h1>
    <h2>Rubrik2</h2>
</a>
<nav>
  <ul>
    <li><a href="index.html" class="vald">Galleri</a></li>
    <li><a href="om.html">Om oss</a></li>
    <li><a href="kontakt.html" class="selected">Kontakt</a></li>
  </ul>
</nav>
  </header>
<div id="wrapper">
  <section>
    <ul id="galleri">
       <li>
        <a href="bild/7.jpg">
        <img src="bild/7.jpg" alt="Bild1">
         <p>text till bild</p>
        </a>
       </li>
       <li>
        <a href="bild/6.jpg">
        <img src="bild/6.jpg" alt="Bild1">
         <p>text till bild</p>
        </a>
       </li>
       <li>
        <a href="bild/3.jpg">
        <img src="bild/3.jpg" alt="Bild1">
         <p>text till bild</p>
        </a>
       </li>
       <li>
        <a href="bild/4.jpg">
        <img src="bild/4.jpg" alt="Bild1">
         <p>text till bild</p>
        </a>
       </li>
       <li>
        <a href="bild/5.jpg">
        <img src="bild/5.jpg" alt="Bild1">
         <p>text till bild</p>
        </a>
       </li>
    </ul>
  </section>
  <footer>
    <a href="http://twitter.com"><img src="bild/twitter-wrap.png" alt="Twitter länk" class="social-ikon"></a>
    <a href="http://facebook.com"><img src="bild/facebook-wrap.png" alt="Facebook länk" class="social-ikon"></a>
   <p>&copy; 2014 - Hemsida</p>

  </footer>
  </div>   
  </body>
</html>
Simon Strömberg
Simon Strömberg
1,423 Points
@media screen and (min-width: 480px) {

/**********************************
Två kolummer layout
***********************************/

    #primary { 
      width: 50%;
      float: left;

  }

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


/**********************************
Galleri: Tre kolummer layout
***********************************/

#galleri li { 
  width: 28.3333%;

 }

#galleri li:nth-child(4n) {
  clear: left;
 }


/**********************************
Om oss: Två kolummer layout
***********************************/

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


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

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

  nav a {
    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%;
  }

  h1 {
    font-size: 2.5em;
  }

  h2 {
    font-size: 0.825em;
    margin-bottom: 20px;
  }

  header {
    border-bottom: 5px solid #599a68;
    margin-bottom: 60px;
  }

}
Simon Strömberg
Simon Strömberg
1,423 Points
/**********************************
GENERAL
***********************************/

body {
  font-family: sans-serif;
}

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

#wrapper p {
  font-size: 16px;
}

a {
  text-decoration: none;
}

img {
  max-width: 100%;
}

h3 {
  margin: 0 0 1em 0;
}



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

header {
  float: left;
  margin: 0 0 30px 0;
  padding: 5px 0 0 0;
  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: 1.25em;
  margin: -5px 0 0;
  font-weight: normal;
}

h3 {
  font-size: 1.0em;
  margin: -5px 0 0;
  font-weight: 800;
}




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

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

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

nav li {
  display: inline-block;
}

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



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

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

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



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

#galleri {
  margin: 0;
  padding: 0;
  list-style: none;
}

#galleri li {
  float: left;
  width: 45%;
  margin: 2.5%;
  background-color: #f5f5f5;
  color: #bdc3c7;
}

#galleri li a p {
  margin: 0;
  padding: 5%;
  font-size: 16px;
  color: #bdc3c7
}



/**********************************
PAGE: OM OSS
***********************************/

.profilbild {
  display: block;
  max-width: 150px;
  margin: 0 auto 30px;
  border-radius: 100%;
}


/**********************************
PAGE: Kontakta oss
***********************************/

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

.kontakt-information a {
display: block;
  min-height: 20px;
  background-repeat: no-repeat;
  background-size: 20px 20px;
  padding: 0 0 0 30px;
  margin: 10px 0 10px;


}

.kontakt-information li.telefon a {
  background-image: url('../bild/phone.png');

}


.kontakt-information li.epost a {
background-image: url('../bild/mail.png');

}


.kontakt-information li.hemsida a {
background-image: url(../bild/twitter.png);

}


/**********************************
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;
}
Simon Strömberg
Simon Strömberg
1,423 Points

ALSO when i re-size the browser so doesnt the portfolio (galleri) page adjust with the images.. It still show 3 images on one row when it have the smallest screen possible. How do i fix that?

Simon Strömberg
Simon Strömberg
1,423 Points

Nevermind, I found the issue, I had an extra "{" at the top.

Wayne Priestley
Wayne Priestley
19,579 Points

Glad you got it sorted Simon.