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
Chris Neil
2,231 PointsImage won't float left during media query (Stage 8- Responsive Web Design)
Hello, in the episode about using media queries to automatically set elements in 2-columns (or just float them to use the browser window width above 480px), my profile pic won't float left despite having the same code as Nick. I even downloaded his code and pasted it in my workspaces. The img should move left and the text move underneath. I've checked my About html to ensure my class is actually class="profile-photo". Here is the whole css, the media query at the top, and the problem code is the bottom part with the profile-photo class:
<@media screen and (min-width: 480px) {
/****************
TWO COLUMN LAYOUT
*****************/
#primary {
width: 50%;
float: left;
}
#secondary {
width: 40%;
float: right;
}
/****************
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; }
}
When I expand the browser above 480px, the image doesn't move left. If anyone ken identify where the problem is, that would be great. I'm sure it's not the image size as it has been resized using css.
Many thanks
3 Answers
jase richards
10,379 PointsYou have < before the @media
Remove it
Chris Neil
2,231 PointsSorry, its not in my workspaces version, I added that on here only because I thought it would be the code display as markup in this forum
Chris Neil
2,231 PointsI played around with this for an hour... couldn't find the error so I just downloaded Nick's code and replaced my entire About.html file. Obviously the fault was there somewhere.
thanks, considered this question solved.