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 Numeric and Textual Data Types

CSS

Challenge task 3 of 3

Using a percentage , set the paragraph to half of its current width .

/* Write your CSS below */ strong{ color:initial; }

div{ width:700px; padding:2em; margin:auto; background-image:url("bg.jpg"); }

p { /color: red;/

width: 50%; font-size: 75%; }

index.html
<!DOCTYPE html>
<html>
<head>
  <title>Numeric and Textual</title>
  <link rel="stylesheet" href="page.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
    <div class="wrapper">
        <p>
            <strong>Aesthetic post-ironic quinoa sartorial, wes anderson twee next level before they sold out fanny pack farm-to-table scenester.</strong> Godard fixie sartorial, keytar bicycle rights gluten-free odd future 8-bit mustache cred. Cred bushwick street art leggings fap DIY. 8-bit fanny pack quinoa vinyl art party jean shorts. Fingerstache, biodiesel kale chips narwhal pinterest tofu echo park pour-over fap raw denim craft beer. Truffaut raw denim, pop-up PBR pork belly mustache food truck cred carles synth. DIY sustainable craft beer, polaroid leggings messenger bag lo-fi twee. Keffiyeh thundercats semiotics, kogi officia tattooed gastropub viral ut skateboard street art.
            <a href="#">Read more &raquo;</a> 
        </p>
    </div>
</body>
</html> 
style.css
/* Write your CSS below */
strong{
color:initial;
}

div{
width:700px;
  padding:2em;
  margin:auto;
  background-image:url("bg.jpg");
}

p {
  /*color: red;*/

  width: 50%;
  font-size: 75%;
}

16 Answers

Remove width:700px; from your div. If I'm not mistaken, p inherits the values from its parent (the div), and the 50% represents the value of that div, not the standard value...

thank you for the explanation, I'll keep studying

Thank you

Have you tried .wrapper p {width: 50%};?

yes

I just tried with p {width: 50%;} (like you did) and it works, so the error must lie somewhere else (not with you). What error are you receiving? Also, for the background image, I used background: url('img/bg.jpg'); -- sometimes the software is touchy.

Bummer Check the length unit in your CSS VALUE

NO NO WORK SORRY

Dude, what error message are you getting? Paste the error message here.

Bummer! Check the length unit in your CSS value.

can you send your code so on...

no no work... inconsistent we need Harold Finch we need Root

i try

Cool.... but i not understand ,

Stefan thanks... good Job

Stefan thanks... good Job

in my opinion, unfounded I do not understand

I suspect that the TeamTreeHouse software expected p to have a certain width value that originates from 50%, but when you gave the div a fixed value of 700px, since the div is the parent of the p, the p inherited a different width value; and the value the software expected to read, changed.

You will understand in the future when you become familiar with css inheritance. Here's a link:

http://reference.sitepoint.com/css/inheritance

For now, learn the basics! :)