Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS CSS Layout Basics Positioning Page Content CSS Positioning Challenge

David Moorhead
David Moorhead
17,992 Points

Here'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.

style.css
/* Complete the challenge by writing CSS below */

.logo {
  position: relative;
  top: 0;
  left: 0;
}
.card {
  position: absolute:
  top: 0;
  left: 0;
}
index.html
<!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
Stuart Wright
41,102 Points

When 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
David Moorhead
17,992 Points

Thanks, Stuart ! All's well, now. And, thanks for the tips, too.