Home >Web Front-end >CSS Tutorial >How to set 4 rounded corners in css? css sets 4 rounded corner methods
How to set css rounded border for div? What are the ways to set 4 rounded corners in css? This is relatively unfamiliar to CSS novices who have just started, so how to set 4 rounded corners in CSS? Let's take a look at the four rounded corner methods set in CSS. [Recommended Learning: CSS3 Tutorial]
CSS3 rounded corners are used to add special colored corners to the body or text by using the border-radius property. The simple syntax for rounded corners is as follows:
#rcorners7 { border-radius: 60px/15px; background: #FF0000; padding: 20px; width: 200px; height: 150px; }
The following table shows the possible values for rounded corners as follows:
Example,This attribute Can have three values. The following example uses two values:
<html> <head> <style> #rcorners1 { border-radius: 25px; background: #8AC007; padding: 20px; width: 200px; height: 150px; } #rcorners2 { border-radius: 25px; border: 2px solid #8AC007; padding: 20px; width: 200px; height: 150px; } #rcorners3 { border-radius: 25px; background: url(/css/images/logo.png); background-position: left top; background-repeat: repeat; padding: 20px; width: 200px; height: 150px; } </style> </head> <body> <p id = "rcorners1">Rounded corners!</p> <p id = "rcorners2">Rounded corners!</p> <p id = "rcorners3">Rounded corners!</p> </body></html>
The effect is:
<html> <head> <style> #rcorners1 { border-radius: 15px 50px 30px 5px; background: #a44170; padding: 20px; width: 100px; height: 100px; } #rcorners2 { border-radius: 15px 50px 30px; background: #a44170; padding: 20px; width: 100px; height: 100px; } #rcorners3 { border-radius: 15px 50px; background: #a44170; padding: 20px; width: 100px; height: 100px; } </style> </head> <body> <p id = "rcorners1"></p> <p id = "rcorners2"></p> <p id = "rcorners3"></p> </body><body>The effect is as follows:
The above is the detailed content of How to set 4 rounded corners in css? css sets 4 rounded corner methods. For more information, please follow other related articles on the PHP Chinese website!