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 trialDavid Moorhead
18,005 PointsHere's Final Task #3 of the course. I'm still puzzled, and cannot put the pieces properly. Your help is appreciated.
Tasks #1 and #2 have passed, but, as you'll see, Task #3 isn't passing. Here are the tasks in case they don't show up in this post.
Challenge Task 1 of 3 Select the class logo and give it absolute positioning.
.logo { position: absolute; }
Challenge Task 2 of 3 Next, give .logo a top offset of -45px and a left offset of 125px.
.logo { position: absolute; top: -45px; left: 125px; }
Challenge Task 3 of 3 The logo's absolute position is relative to the browser viewport. Make .card the new positioning context for .logo.
.logo { position: relative; top: 0; left: 0; } .card { position: absolute: top: 0; left: 0; } ^ Although the design result appeared presentable after numerous code attempts, Task 3 begins the loop back to Task 1 as "Oops! It looks like Task 1 is no longer passing."
Thank You for your help. DM.
/* Complete the challenge by writing CSS below */
.logo {
position: relative;
top: 0;
left: 0;
}
.card {
position: absolute:
top: 0;
left: 0;
}
<!DOCTYPE html>
<html>
<head>
<title>CSS Positioning</title>
<link href='https://fonts.googleapis.com/css?family=Varela+Round' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="page.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="card">
<img class="logo" src="city-logo.svg" alt="logo">
<h2>Best City Guide</h2>
<p>Cheesecake oat cake marshmallow. Bonbon pastry apple pie danish donut bonbon marshmallow caramels. Bear claw chocolate bar lemon drops. Carrot cake jelly beans jelly beans pie.</p>
</div>
</body>
</html>
1 Answer
Stuart Wright
41,120 PointsWhen you attempt task 3, make sure you don't change your code from tasks 1 and 2.
You have .logo set to 'relative' currently, but it needs to be 'absolute' to pass task 1. You've also got rid of the -45px and 125px offsets needed to pass task 2.
You also have a syntax error:
position: absolute:
The above line needs to end with a semi-colon, not a colon.
To pass task 3, it's the .card that you need to set to relative.
David Moorhead
18,005 PointsDavid Moorhead
18,005 PointsThanks, Stuart ! All's well, now. And, thanks for the tips, too.