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 trialAmy Turbyfill
984 Points.profile-photo not floating left
this is driving me crazy. i've tried everything I can think of.
@media screen and (max-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: PORTFOLIO
***********************************/
.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;
}
3 Answers
Amy Turbyfill
984 Points@Jennifer Nordell that was a good idea but it still didn't work :(
Jennifer Nordell
Treehouse TeacherCould I see your HTML please? :)
Amy Turbyfill
984 Points@media screen and (max-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: PORTFOLIO
***********************************/
.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;
}
Jennifer Nordell
Treehouse TeacherThat's your CSS not your HTML. But I'll do what I can to help. You've got some extraneous closed curly braces to begin with.
#secondary {
width: 40%;
float: right;
}
} /* Remove this curly brace */
.profile-photo {
float:left; /* Try adding a space here ... float: left; */
margin: 0 5% 80px 0;
}
} /* Remove this curly brace */
Also, while CSS isn't generally very picky about spacing ... there are occasions when something won't work because a space is either exists or lacking. Try placing a space between your float:left
. Ie float: left
.
Amy Turbyfill
984 PointsJennifer Nordell
HTML from my about page:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Amy Turbyfill | Designer</title>
<link rel="stylesheet" href="css/normalize.css">
<link href='https://fonts.googleapis.com/css?family=Changa+One|Open+Sans:400,400italic,700italic,800' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/main.css">
<link rel="stlyesheet" href="css/responsive.css">
</head>
<body>
<header>
<a href="index.html" id="logo">
<h1>Amy Turbyfill</h1>
<h2>Designer</h2>
</a>
<nav>
<ul>
<li><a href="index.html" >Portfolio</a></li>
<li><a href="about.html" class="selected">About</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>
</nav>
</header>
<div id="wrapper">
<section>
<img src="img/chicken.jpg" alt="photograph of Amy Turbyfill" class="profile-photo">
<h3>About</h3>
<p>Hi, I'm Amy Turbyfill! This is my design portfolio where I share all my favorite work. When I'm not designing things, I enjoy exercising, playing video games, drinking good coffee, and more.</p>
<p>If you'd like to follow me on Twitter, my username is <a href="http://twitter.com/aturbyfi">@aturbyfi</a>.</p>
</section>
<footer>
<a href= "http://twitter.com/aturbyfi"><img src="img/twitter-wrap.png" alt="Twitter Logo" class="social-icon"></a>
<a href="http://facebook.com/amy.turbyfill"><img src="img/facebook-wrap.png" alt="Facebook Logo" class="social-icon"></a>
<p>© 2016 Amy Turbyfill.</p>
</footer>
</div>
</body>
</html>
Jennifer Nordell
Treehouse TeacherJennifer Nordell
Treehouse TeacherTry moving your media query to the very bottom of your CSS file. I'm thinking something is overwriting your float.