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 Build a Three Column Layout

Smaller captions affecting images

So when I copy the text exact as in the tutorial the images work fine. But when I made the text shorter, image 6 alternated left and right when expanding and minimizing the screen, and image 3 was positioned on the right at a certain page size.

Is there any way of fixing this to make it more device friendly?

Wayne Priestley
Wayne Priestley
19,579 Points

Hi David,

Could you please post your html and css so we can take a look and help you out.

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.

Hope this helps.

3 Answers

<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <!--How websites are formatted--> <title>David | Soccer Player</title> <link rel="stylesheet" href="css/normalize.css"> <link href='http://fonts.googleapis.com/css?family=Changa+One|Open+Sans:400,400italic,700,700italic,800' rel='stylesheet' type='text/css'> <link rel="stylesheet" href="css/main.css"> <link rel="stylesheet" href="css/responsive.css"> <meta name="viewport" content="width=device-width, initial-scale=1.0">

</head> <body> <header> <a href="index.html" id="logo"> <h1>David </h1> <h2>Soccer Player</h2> </a> <nav> <ul> <li><a href="index.html" class="selected">Portfolio</a></li> <li><a href="about.html">About</a></li> <li><a href="contact.html">Contact</a></li> </ul> </nav> </header> <div id="wrapper"> <section> <ul id="gallery"> <li> <a href="img/numbers-01.jpg"> <img src="img/numbers-01.jpg" alt=""> <p>Experimentation with color and texture.</p> </a> </li> <li> <a href="img/numbers-02.jpg"> <img src="img/numbers-02.jpg" alt=""> <p>Playing with blending modes in Photoshop.</p> </a> </li> <li> <a href="img/numbers-06.jpg"> <img src="img/numbers-06.jpg" alt=""> <p>Trying to create an 80s style of glows.</p> </a> </li> <li> <a href="img/numbers-09.jpg"> <img src="img/numbers-09.jpg" alt=""> <p>Drips</p> </a> </li> <li> <a href="img/numbers-12.jpg"> <img src="img/numbers-12.jpg" alt=""> <p>Creating</p> </a> </li> </ul> </section> <footer> <a href="http://twitter.com/dave"><img src="img/twitter-wrap.png" alt="Twitter Logo" class="social-icon"></a> <a href="http://facebook.com/dave"><img src="img/facebook-wrap.png" alt="Facebook Logo" class="social-icon"></a> <p>Ā© 2014 David .</p>

</footer>
</div>

</body>

</html>

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

/************************ TWO COLUMN LAYOUT *************************/

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

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

/************************
3 * (2.5+2.5) =15
100% -15%= 85%
85 / 3 = 28.33333333
*************************/


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

#gallery li { width: 28.3333%; }

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

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

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

}

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

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

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

I shortened the text for the 5th and 6th image and it causes the image to jolt around when I minimize/maximize. The images are ok though if I copy the text exactly in the video..

Sorry I couldnt figure out how to post the css code smoothly :/