CSS 效果 圆形里一个文字居中-CSDN博客
阿里云国内75折 回扣 微信号:monov8 |
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6 |
效果实现源码
宽度高度必须确认且相等
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
.circlew {
width: 45px;
height: 45px;
border-radius: 50%; /* 将容器设置为圆形 */
background-color: #ff9900;
display: flex;
justify-content: center; /* 居中显示 */
align-items: center; /* 居中显示 */
}
.txt {
color: #ffffff;
font-size: 26rpx;
}
</style>
</head>
<body>
<div class="circlew"><span class="txt">租</span></div>
</body>
</html>
效果