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 Animating SVG with CSS Transitions and Transforms Transitions and Transforms

Target the class star and transition the rotation over .8s. HELP!!

It would be greatly appreciated if anyone will help me i dont know what I am doing wrong much appreciated ; Alex

index.html
<!DOCTYPE html>
<html>
<head>
    <title>Animating SVG with CSS</title>
    <link rel="stylesheet" href="base.css">
    <link rel="stylesheet" href="style.css">
</head>
<body>
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="60 60 240 240">
        <circle class="star-bg" fill="#40adcf" stroke="#fff" stroke-width="6" cx="180" cy="180" r="108.3"/>
        <path class="star" fill="#fff" stroke="#fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M180 107.8l16.9 52.1h54.8l-44.3 32.2 16.9 52.1-44.3-32.2-44.3 32.2 16.9-52.1-44.3-32.2h54.8z"/>
  </svg>
</body>
</html>
<svg>
  <g>
    <!-- Other Stuff To Be Grouped Goes Here-->
  </g>

</svg>
style.css
/* Complete the challenge by writing CSS below */
.star-bg {
    transition: fill 1s;
}

.star-bg:hover {
  fill: steelblue;
}
.star {
  transition: transform.8s;
  transform-origin: 50% 50%;
}
.star:hover {
  transform: rotate (180deg);
}
.start-bg{transition: fill .1s;}
.start-bg{transition: width .1s;}
.start-bg{transition: all .1s;}
.star-bg { transition: fill .1s; }
.star-bg:hover {fill: #000000;}
.starbg:hober{color: steelbblue;}
.star-bg: hover{rotation: 180 degrees;}
.start-bg{rotation: all .8s ease ;}

I haven't looked at what your code displays, yet, but I did notice that you typed ".starbg" instead of ".star-bg" and "hober" instead of "hover". Also, depending on your browser, you may need to include the appropriate prefixes for your animations to display properly. Hope that helps!

2 Answers

Challenge Task 5 of 6

Target the class star and transition the rotation over .8s.

.star-bg { transition: fill 1s; } .star-bg:hover { fill: yellow; rotation: 180 deg; }

.star-big: hover { fill: steelblue; }

.star:hover { transform: rotate (180deg); }

.star { transition: transform .8s; }

Challenge Task 5 of 6

Target the class star and transition the rotation over .8s.

.star-bg { transition: fill 1s; } .star-bg:hover { fill: yellow; rotation: 180 deg; }

.star-big: hover { fill: steelblue; }

.star:hover { transform: rotate (180deg); }

.star { transition: transform .8s; }