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

HTML

Jen Stratton
Jen Stratton
2,427 Points

Code cuts off section off inner circle

SVG looks as the example, other than part of the design cut off on both the left and right sides. Not sure what happened here.

SVG HTML: <svg class="graphic" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 360 360" enable-background="new 0 0 360 360"> <path fill="#8361B4" d="M0 0h360v360h-360z"/> <circle class="outer-circle" fill="#FDE135" stroke="#fff" stroke-width="8" stroke-miterlimit="10" cx="180" cy="180" r="157"/> <circle class="inner-circle" fill="#CAA61F" stroke="#fff" stroke-width="8" stroke-miterlimit="10" cx="180" cy="180" r="108.3"/> <path class="outer-circle" d="M89.4 276.7c-26-24.2-42.2-58.8-42.2-97.1 0-22.6 5.6-43.8 15.5-62.4m234.7.1c9.9 18.6 15.4 39.7 15.4 62.2 0 38.3-16.2 72.8-42.1 97" stroke="#CAA61F" stroke-width="8" stroke-linecap="round" stroke-miterlimit="10" fill="none"/> <path class="star" fill="#FDE135" stroke="#fff" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" 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"/> <circle class="star-point" fill="#CAA61F" stroke="#fff" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" cx="180" cy="107.8" r="4.4"/> <circle class="star-point"fill="#CAA61F" stroke="#fff" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" cx="223.7" cy="244.2" r="4.4"/> <circle class="star-point" fill="#CAA61F" stroke="#fff" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" cx="135.5" cy="244.2" r="4.4"/> <circle class="star-point" fill="#CAA61F" stroke="#fff" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" cx="108.3" cy="160.4" r="4.4"/> <circle class="star-point" fill="#CAA61F" stroke="#fff" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" cx="251.7" cy="160.4" r="4.4"/> <circle class="star-point" fill="#CAA61F" stroke="#fff" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" cx="197.4" cy="159.4" r="4.4"/> <circle class="star-point" fill="#CAA61F" stroke="#fff" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" cx="163" cy="159.4" r="4.4"/> <circle class="star-point" fill="#CAA61F" stroke="#fff" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" cx="152" cy="192.5" r="4.4"/> <circle class="star-point" fill="#CAA61F" stroke="#fff" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" cx="208" cy="192.5" r="4.4"/> <circle class="star-point" fill="#CAA61F" stroke="#fff" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" cx="180" cy="213.2" r="4.4"/> </svg> </div>

SVG CSS: *, *:before, *:after { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }

body { font-family: 'Nunito', sans-serif; color: #384047; }

.wrapper { max-width: 90%; margin: 10px auto; padding: 10px 20px; background: #f4f7f8; border-radius: 8px; }

h1, h2 { margin: 30px 0; text-align: center; }

.outer-circle { fill: #FDE135; }

.graphic { margin: 1em auto; width: 30%; display: block; } .star-point, .outer-circle { opacity: 0; }

.inner-circle { stroke-opacity: 0; }

.star { stroke-width: 8; }

.media only screen and (min-width: 30em) { .inner-circle { stroke-opacity: 1; } }

@media only screen and (min-width: 40em) { .outer-circle { opacity: 1; } .star { stroke-width: 4; } } @media only screen and (min-width:64em) { .star-point { opacity: 1; } }

eslam said
eslam said
Courses Plus Student 6,734 Points

Wrap your code with 3 backticks (```) on the line before and after

1 Answer

Steven Parker
Steven Parker
229,708 Points

That circle isn't actually being "cut off", but overlaid by filled arcs attached to the two arc shapes on either side of the outer circle. Those shapes are created by a "path" element that shares the "outer-circle" class with the outer circle itself, but they normally have the fill set to "none" so only their strokes are visible.

But in the CSS, the "outer-circle" class is given a fill setting, which overrides the "none" in the SVG code and adds a fill to the two arcs, creating the "cut off" appearance of the inner circle.

Just remove that fill setting from the CSS to make the inner circle appear round again.

.outer-circle { fill: #FDE135; }  /* remove this line */