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

positioning

The logo's absolute position is relative to the browser viewport. Make .card the new positioning context for .logo.

style.css
/* Complete the challenge by writing CSS below */
.logo{
position:absolute;   
}
.logo{
  top:-45px;
  left:125px;
}
.card{
  p
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

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

This challenge encourages you to go into the index.html and look at the structure of the document. Because logo is absolutely positioned it is absolutely positioned relative to the last element that has a position set. It's inside the card class and that doesn't currently have a position set. So now it wants you to set the class "card" to relative so that it'll be absolutely positioned in relation to "card". And don't worry, absolute and relative positioning is tricky to learn. We all get confused (I think)! :thumbsup: Here's what you need:

.card{
  position: relative;
}