在CSS中设置下划线可以通过以下几种方法:
1. 使用 `text-decoration: underline;`
```css
p {
text-decoration: underline;
}
```
2. 使用 `border-bottom` 属性
```css
p {
border-bottom: 1px solid 000000;
}
```
3. 使用 `text-decoration` 属性进行定制
```css
p {
text-decoration: underline-color 000000;
text-decoration-thickness: 2px;
text-decoration-style: solid;
}
```
4. 使用 `text-decoration` 属性移除下划线
```css
p {
text-decoration: none;
}
```
5. 使用 `text-decoration` 属性实现动态文本下划线效果
```css
p {
text-decoration: none;
transition: text-decoration 0.5s ease-in-out;
}
p:hover {
text-decoration: underline;
}
```
以上方法可以实现不同的下划线样式,包括颜色、粗细、样式等。您可以根据需要选择合适的方法来美化您的文本内容