Home >Web Front-end >CSS Tutorial >How to set rounded borders in css? How to set rounded borders in css (image and text)
How to set the border in css? Many times when developing the front-end of a web page, in order to make the things on the web page look more comfortable, we may need to set some rounded borders such as buttons. So, how do we set rounded borders? This article will introduce to you how to set rounded borders in CSS.
The most common and simplest way to set a rounded border in css is to use the border-radius attribute.
CSS rounded corners only need to set one property: border-radius (meaning "border radius"). You provide a value for this property to set the radii of all four corners at the same time. All legal CSS measurements can be used: em, ex, pt, px, percentage, etc.
Let’s take a look at a css code example to set a rounded border:
<!DOCTYPE html> <html> <head> <style> div { text-align:center; border:2px solid #a1a1a1; padding:80px 40px; background:pink; width:150px; border-radius:25px; -moz-border-radius:25px; /* 老的 Firefox */ } </style> </head> <body> <div>圆角边框</div> </body> </html>
The effect is as follows:
border-radius can be set to 1 at the same time to 4 values.
If you set a value, it means that all four fillets use this value.
css rounded border code: border-radius: 15px;
border-top-right-radius
border-bottom-right-radius
border -bottom-left-radius
css manual.
The above is the detailed content of How to set rounded borders in css? How to set rounded borders in css (image and text). For more information, please follow other related articles on the PHP Chinese website!