border-radius:
时间: 2023-09-08 22:14:48 浏览: 86
border-radius:使用html和css创建边框半径的小练习
The border-radius property is used to define the radius of the corners of an element's border. It is a shorthand property for the following four individual properties:
- border-top-left-radius
- border-top-right-radius
- border-bottom-right-radius
- border-bottom-left-radius
The value of the border-radius property can be specified in either pixels, percentages, or the keyword "auto". When using percentages, the value is relative to the width of the element.
For example, the following code sets a border radius of 10 pixels for all corners of an element:
```
border-radius: 10px;
```
Alternatively, you can specify different radius values for each corner:
```
border-radius: 10px 5px 20px 15px;
```
This sets the top-left corner to 10 pixels, top-right to 5 pixels, bottom-right to 20 pixels, and bottom-left to 15 pixels.
阅读全文