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 Selectors Advanced Selectors Pseudo-Elements Challenge

Angus Eliott
Angus Eliott
3,793 Points

pseudo malfunction

help! what's wrong with the attached code? (do not know selector to put in line 11)

style.css
/*1*/ /* Complete the challenge by writing CSS below */
/*2*/
/*3*/.progbar::after {
 /*4*/ content: "";
 /*5*/ display: block;
 /*6*/ width: 50%;
  /*7*/height: 100%;
 /*8*/ border-radius: inherit;
/*9*/background-color: #5ece7f; 
/*10*/}
/*11*/::after a {
 /*12*/ content: href;
/*13*/}
/*14*/
/*15*/.progbar.progbar::before {
/*16*/  content: "";
/*17*/  display: block;
/*18*/  width: 24px;
/*19*/  height: 24px;
/*20*/  border-radius: 50%;
/*21*/  position: absolute;
/*22*/  left: 49%;
/*23*/  top: -9px;
/*24*/  background-color: #7dd898; 
/*25*/}
/*26*/
/*27*/.progbar {
  /*28*/height: 6px;
  /*29*/border-radius: 3px;
/*30*/  background: #d6d7d9;
/*31*/  position: relative;
/*32*/  margin-bottom: 3.875em; 
/*33*/}
index.html
<!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>

1 Answer

The issue you are facing is that right now you are not targeting the anchor (a) with the ::after pseudo.

To target this, you would use:

a::after

To extract the href attribute, you need to use the css function of attr. e.g

content: attr(href);

In turn leaving you with:

a::after{
  content: attr(href); 
}

I hope this helps.