border-bottom
时间: 2023-12-22 16:05:37 浏览: 79
The border-bottom property is used to set the style, width, and color of the bottom border of an element. It can be applied to any HTML element and is part of the CSS box model.
The syntax for border-bottom is as follows:
```
border-bottom: [border-width] [border-style] [border-color];
```
The values for each property are:
- border-width: Specifies the width of the border. It can be set in pixels, ems, rems, or other CSS units. The default value is medium.
- border-style: Specifies the style of the border. It can be solid, dashed, dotted, double, groove, ridge, inset, outset, or none. The default value is none.
- border-color: Specifies the color of the border. It can be set in a variety of ways, such as using named colors, hexadecimal values, RGB values, or HSL values. The default value is the color of the element's text.
For example, to create a solid, red border at the bottom of a paragraph element, you could use the following code:
```
p {
border-bottom: 2px solid red;
}
```
This would create a 2-pixel-wide red line at the bottom of the paragraph.
阅读全文