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

Ulises Calvo
Ulises Calvo
2,233 Points

what is wrong with my code

Again, I'm stuck. Can anyone tell me what is wrong with my code?, I can't manage to figure it out, thank you.

style.css
/* Complete the challenge by writing CSS below */
.main-header {
  background-image: linear-gradient( to top, steelblue, 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

Jaime Rios
PLUS
Jaime Rios
Courses Plus Student 21,100 Points

I just checked it, just the space between "(" and "to top"

This should work

/* Complete the challenge by writing CSS below */ .main-header { background-image: linear-gradient( to bottom, steelblue, darkslateblue 90%); }

Jaime Rios
Jaime Rios
Courses Plus Student 21,100 Points

The preview shows what is intended to make, just some bug with Treehouse site, I just used it without the space and it solved the problem.

Ulises Calvo
Ulises Calvo
2,233 Points

I appreciate it Jaime, I managed!!! thanks a lot!

Aaron Gill-Braun
Aaron Gill-Braun
180 Points

Here some examples of top to bottom gradience in css : <style>

grad1 {

height: 200px;
background: -webkit-linear-gradient(red, blue); /* For Safari 5.1 to 6.0 */
background: -o-linear-gradient(red, blue); /* For Opera 11.1 to 12.0 */
background: -moz-linear-gradient(red, blue); /* For Firefox 3.6 to 15 */
background: linear-gradient(red, blue); /* Standard syntax (must be last) */

} </style>

Your braces were all messed up. Hope this works!