HTML Academy
Rectangle Coordinates
An Introduction to SVG4/15
Back to the list of tasks
  • 1. Hello, SVG!
  • 2. Drawing a Rectangle
  • 3. Rectangle Coordinates
  • 4. Corner Rounding
  • 5. Challenge: Fixing the TV
  • 6. Polygons
  • 7. Challenge: Pyramids
  • 8. Drawing a Circle
  • 9. Challenge: Target
  • 10. Drawing an Ellipse
  • 11. Challenge: Surprised Smiley
  • 12. Drawing Lines
  • 13. Challenge: Arithmetic Operators
  • 14. Drawing Polylines
  • 15. Challenge: Hot-Air Balloons
Challenge: Fixing the TV
  • Sign up
  • Log in

Loading…
Everything will be ready in few seconds

  • Theory
  • Theory
  • Comments

Corner Rounding

The rounding of rectangle corners can be controlled using the parameters rx andry. The rx attribute sets rounding along the horizontal axis, andry is used to specify it for the vertical one. If the ry attribute is not specified, it will be equal to rx.

Code example:

<rect width="50%" height="100" rx="50" ry="20"/>

Comments

  • object.svg
  • style.css
SVG
<svg> <rect width="50%" height="100" x="25%" y="25" fill="orange" /> </svg>
CSS
svg { border: 1px solid #dddddd; }

What didn’t you like in this task?

Thanks! We’ll fix everything at once!

The code has changed, click “Refresh” or turn autorun on.

You’ve gone to a different page

Click inside the mini-browser to shift the focus onto this window.

100%
Goalscompleted
0
    1. Set the value for rx to 20.
    2. Set the value for ry to 50. Notice how the shape changes.

    Cookies ∙ Privacy ∙ License Agreement ∙ About ∙ Contacts ∙ © HTML Academy OÜ, 2019−2025

    VISAMastercard

    Log in

    or

    Forgot your password?

    Sign up

    Sign up

    or
    Log in

    Restore access

    Have you forgotten your password or lost access to your profile? Enter your email connected to your profile and we will send you a link to restore access.

    Forgot to connect your email to the profile? Email us and we’ll help.