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

how do you make your buttons background color change orange when you hover over them???

how do you make your buttons background color change orange when you hover over them???
ive tried a couple things and it doesn't seem to work

https://w.trhou.se/7osskc34ax https://w.trhou.se/7osskc34ax https://w.trhou.se/7osskc34ax

3 Answers

Hi,

You use pseudo-class hover.

Example

<!-- html -->
<button class="buttons">button</button>

// css
button:hover {
  background-color: orange;
}

yes here is the link to my code https://w.trhou.se/7osskc34ax

Just add a hover psuedo-class.

For example:

HTML

<button class="mybutton"> My Button </button>

CSS

.mybutton {
  background: tomato
}

.mybutton:hover {
   background: teal; 
}

I did here is my code https://w.trhou.se/7osskc34ax

I hope I got Your question right!

button:hover { background: orange; }