demonstrate with an example to use rounded corner by using CSS
时间: 2024-03-18 09:39:27 浏览: 22
Sure, here's an example of how to use CSS to create rounded corners:
HTML code:
```html
<div class="box">
<p>This is a box with rounded corners.</p>
</div>
```
CSS code:
```css
.box {
background-color: #f1f1f1;
border-radius: 10px; /* sets the border radius to 10 pixels */
padding: 20px;
}
```
In this example, we use the `border-radius` property to set the radius of the corners to 10 pixels. The `padding` property is also used to create some space between the content and the edges of the box. The end result is a box with rounded corners and a light gray background color. You can adjust the `border-radius` value to make the corners more or less rounded, depending on your preference.