How do you make a div so that its border corners are rounded?
How to make a div with rounded corners
Asked Answered
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>
It's best if you remember to use prefixes such as "moz" (for Mozilla) and "webkit" (for Safari and Chrome.) Maybe there are more that I don't know about. –
Quiroz
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 don't want to rely on pixels, you can always use %
border-radius: 50%;
Just use "border-radius"
css property like this:
div {
border-radius:8px;
}
© 2022 - 2024 — McMap. All rights reserved.