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 trialJared Rauh
4,879 PointsI'm adding: content: attr(" "); and it is telling that's wrong
I'm adding:
content: attr(" ");
and it is telling that's wrong
/* Complete the challenge by writing CSS below */
.progbar::after {
content: attr();
display: block;
width: 50%;
height: 100%;
border-radius: inherit;
background-color: #5ece7f;
}
.progbar {
display: block;
width: 24px;
height: 24px;
border-radius: 50%;
position: absolute;
left: 49%;
top: -9px;
background-color: #7dd898;
}
.progbar {
height: 6px;
border-radius: 3px;
background: #d6d7d9;
position: relative;
margin-bottom: 3.875em;
}
<!DOCTYPE html>
<html>
<head>
<title>Selectors</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="page.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="progbar"></div>
<a href="http://teamtreehouse.com">Check out the URL: </a>
</body>
</html>
5 Answers
Lisa Nguyen
22,731 PointsOh I see, then you'd want this instead:
.progbar::after {
content: "";
display: block;
width: 50%;
height: 100%;
border-radius: inherit;
background-color: #5ece7f;
}
Lisa Nguyen
22,731 PointsHi Jared, it wants you to pass in a href attribute after the anchor, like this:
a::after {
content: attr(href);
}
Jared Rauh
4,879 Pointsthat didn't work :(
The question says "In the same rule, add the property that lets us insert content into an element. The value should be an empty set of quotes."
Jennifer Nordell
Treehouse TeacherI agree with Lisa Nguyen and can confirm that this code passes:
.progbar::after {
content: "";
display: block;
width: 50%;
height: 100%;
border-radius: inherit;
background-color: #5ece7f;
}
If you copy paste this into the first progbar selector and it still fails, you might consider trying in a new browser (on the off chance there's something strange going on there). If it still persists, you're probably going to have to contact treehouse support.
Nicole Chinn
8,122 PointsI can confirm that the code works when you add the ::after psuedo element to the second css rule.
.progbar::after {
content: "";
display: block;
width: 24px;
height: 24px;
border-radius: 50%;
position: absolute;
left: 49%;
top: -9px;
background-color: #7dd898;
}
Rayssa Estrela
6,191 PointsHi Jared I see what is wrong, you just forgot that on this particular question has "insert a pseudo-element after an "a" element". So the code it will be: .progbar a::after { content: attr(href); display: block; width: 24px; height: 24px; border-radius: 50%; position: absolute; left: 49%; top: -9px; background-color: #7dd898; }
:)
Jared Rauh
4,879 PointsJared Rauh
4,879 Pointsdidn't work either :(
Lisa Nguyen
22,731 PointsLisa Nguyen
22,731 PointsHmm, would you be able to add the code you used for that task because content: ""; seems to work for me?