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 Foundations The Box Model Positioning Properties

Benjamin Beezy
Benjamin Beezy
7,409 Points

I'm not sure why my .middle isn't passing.

I think I have everything right. Any ideas about what could be happening?

index.html
<!DOCTYPE html>
<html>
<head>
    <title>Positioning</title>
    <link rel="stylesheet" href="page.css">
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <div class="wrapper">
        <div class="top">Top</div>
        <div class="middle">Middle</div>
        <div class="bottom">Bottom</div>
    </div>
</body>
</html>
style.css
/* Complete the challenge by writing CSS below */
.wrapper { position: relative; };

.middle { position: relative; left: 100px; };

3 Answers

Shawn Williams
PLUS
Shawn Williams
Courses Plus Student 4,462 Points

Have you tried removing the semi-colons that are located after the brackets? These are not needed.

Benjamin Beezy
Benjamin Beezy
7,409 Points

Wow. That worked. Thanks so much. However, I always thought it was best practice to put semi-colons after every rule. Is that not the case?

Shawn Williams
PLUS
Shawn Williams
Courses Plus Student 4,462 Points

The rules are what is located inside the selector. The brackets belong to the selector and not the rules.

If you do that then your code is wrong. You don't put the semi-colons inside the brackets because you are not doing JQuery which requires the semi-colon.

Shawn Williams
Shawn Williams
Courses Plus Student 4,462 Points

Samuel, the semicolons ONLY go inside the brackets in CSS.