rounded corner rectangle html code example

Example 1: css rounded corners

/* Set rounded corners with border-radius property */

.class {
  border-radius: 4px;
}

.circle {
  border-radius: 50%;
}

Example 2: html draw rectangle with rounded corners

<!DOCTYPE html>
<html>
   <head>
      <style>
         #svgelem {
            position: relative;
            left: 10%;
            -webkit-transform: translateX(-20%);
            -ms-transform: translateX(-20%);
            transform: translateX(-20%);
         }
      </style>
      <title>SVG</title>
   </head>

   <body>
      <h2>HTML5 SVG Rectangle</h2>
      <svg id="svgelem" width="300" height="200" xmlns="http://www.w3.org/2000/svg">
         <rect x="50" y="20" rx="30" ry="30" width="150" height="150"
            style="fill:blue;/">
      </svg>
   </body>
</html>

Tags:

Css Example