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 Values and Units Color Values

Craig Curtis
Craig Curtis
19,985 Points

I'm trying to figure out how Guil got the text behind the div. Couldn't find it in the CodePen example.

Looked in CodePen and found nothing.

HTML:

 <div></div>

CSS:

div {

/*  
    -- Predefined Keyword Examples -- 

    background-color: red;
    background-color: green;
    background-color: blue;
    background-color: lightblue;
    background-color: tomato;
    background-color: sandybrown;
*/

/*  
    -- Hexadecimal Examples -- 

    background-color: #FF0033;

*/

/*  
    -- RGBa Example -- 

    background-color: rgba(65,105,255, .9);

*/

/*  -- HSLa Example --  */

    background-color: hsla(130,50%,35%,.1); 

}

1 Answer

geoffrey
geoffrey
28,736 Points

Inside codepen, if you click on the gearing icon next to the HTML text you'll see a window with a space named stuff for < head >

It seems he added some styles there to display the text. Check the styles below, that's what I've just copied from there.

div:after {
    content: "I'm behind the div!";
    font-size: 2em;
    position: absolute;
    top: 40%;
    left: 35%;
    z-index: -1;
}