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: Color Stops

is there any thing wrong with that syntax?

i were playing with the gradients then i wanted to set my color to top the i said

.333{background-image:linear-gradient(at top,black ,white)}

then the value didn't respond why the value didn't respond?.

Cory Harkins
Cory Harkins
16,500 Points
.box{
  width: 500px;
  height: 500px;
  background:linear-gradient(white ,black)
}

First: Try not to label your classes as numbers. It's non-semantic, and I don't believe it's acceptable CSS syntax.

Second: When using a linear-gradient, if you are going from top-bottom, bottom-top; you really don't have to specify that "to", when dealing with two colors. Just swap the values if the outcome isn't desired (white, black / black, white).

in HTML:

<div class="box"></div>

in CSS:

.box{
  width: 500px;
  height: 500px;
  background:linear-gradient(white ,black)
}

well cory... well i think you got me wrong i meant to set the color to top and ends in the bottom but thank you for the answer.

1 Answer

Cory Harkins
Cory Harkins
16,500 Points

Sorry, I just re-read my answer, and it seemed kind of douchey. I apologize for that.

no problem!.