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 trialmsdsmd sm,dfsadf
1,124 PointsPlease, someone, help to position SVG with two circles inside the SVG tag
<!DOCTYPE html>
<html>
<body>
<svg height="100" width="100" fill="none">
<style>
circle{
stroke-width:100px;
}
svg{
border-radius:50%; background:;
}
</style>
<circle cx="50%" cy="50%" r="47" stroke="blue" stroke-dasharray="30 295.16" />
<circle cx="50%" cy="50%" r="47" stroke="green" stroke-dasharray="50 295.16" />
</svg>
<script>
</script>
</body>
</html>
I tried to position the difference circle inside the SVG tag, but is there any way to know the exact numbers of stroke-dash offset that I need to apply to the circle instead of just randomly set the stroke-dash offset to a random number.
1 Answer
Reggie Williams
Treehouse Teachermsdsmd sm,dfsadf the different values you give stoke-dasharray will determine how many and what sized dashes. Check out the documentation here for examples https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray