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 Basics (2014) Enhancing the Design With CSS Gradients

sesha anil kumar
sesha anil kumar
1,484 Points

Set the second color stop's position to 90%. Then, add the value that sets the gradient direction from bottom to top

my css written ode is correct what is problem

style.css
/* Complete the challenge by writing CSS below */
.main-header {
  background-image: linear-gradient(bottom, steelblue 0%, darkslateblue 90% )
}
index.html
<!DOCTYPE html>
<html>
  <head>
    <title>Lake Tahoe</title>
    <link rel="stylesheet" href="page.css">
    <link rel="stylesheet" href="style.css">
  </head>
  <body> 
    <header id="top" class="main-header">
      <span class="title">Journey Through the Sierra Nevada Mountains</span>
      <h1 class="main-heading">Lake Tahoe, California</h1>
    </header>

        <div class="primary-content">
            <p class="intro">
                Lake Tahoe is one of the most breathtaking attractions located in California. It's home to a number of ski resorts, summer outdoor recreation, and tourist attractions. Snow and skiing are a significant part of the area's reputation.
            </p>
            <a class="callout" href="#more">Find out more</a>
        </div><!-- End .primary-content -->
  </body>
</html>

2 Answers

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

Hi there! You're very close but there are two things going on here. First, you're including the 0% as the first stop which is the default and the challenge doesn't like it. At that point, you will get a Bummer message about including the 0%. But the biggest problem here lies in the interpretation of the instructions. The instructions ask you to create a gradient that goes from the bottom to the top. Your gradient should start off with to top.

Once I fix these two minor things, your code passes the final step.

Hope this helps! :sparkles:

Shay Paustovsky
Shay Paustovsky
969 Points

Hi, You're doing great just a few comments and fixes.

  1. The direction of the gradient is determined using either: 'to' + 'direction keyword', <degrees>. here you simply forgot the 'to' keyword.
background-image: linear-gradient(to top/bottom/left/right, color-stop 1, color-stop 2)

for the first color you do not need to specify a color stop since it's the color the gradient begins with.

Happy Coding

Shay