Answer the question
In order to leave comments, you need to log in
How to draw an SVG circle with a given block width/height using JavaScript?
All good time.
The task is next.
There is a square block with dynamic dimensions. How to use JS (knowing the height and width of the block) to draw the correct circle path inside the block with its dimensions?
Answer the question
In order to leave comments, you need to log in
Hello. If you need a circle, then you don't need a path, you need a circle:
jsfiddle.net/qnmy8kay
Accordingly, insert the necessary values into its attributes.
You can draw a circle without SVG!
.test {
width: 100px;
height: 100px;
background: #000;
border-radius: 50%; // вот так
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question