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

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.