How do you make a div so that its border corners are rounded?
If we want to apply only margin side border-radius then CSS provides predefined properties. border-top-left-radius: 10px: apply border-radius 10px to top-left side. border-top-right-radius: 10px: apply border radius 10px to top-right side. border-bottom-left-radius: 10px: apply border radius 10px to bottom-left side.
The border-radius CSS property rounds the corners of an element's outer border edge.
Use the CSS border-radius property to add rounded corners to the table cells.
Here it is:
<style type="text/css">
div.test
{
width: 115px;
padding: 10px;
border: 2px solid #000;
border-radius: 15px;
-moz-border-radius: 15px;
}
</style>
<div class="test">This is some text!</div>
Use the border-radius
property. The higher the specified amount (typically in px
), the more rounded your shape. Example:
myDiv { border-radius:30px;}
Hope that helps.
add this css:
border-top-right-radius:15px;
border-top-left-radius:15px;
border-bottom-right-radius:15px;
border-bottom-left-radius:15px;
With CSS add the code: border-radius: 10px
.
I use 10px for example, but you can experiment with however amount of pixels you like.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With