可以通过以下方式实现:
<div class="circle">文本</div>
.circle {
width: 100px;
height: 100px;
border-radius: 50%;
background-color: #f00;
color: #fff;
text-align: center;
line-height: 100px;
}
推荐的腾讯云相关产品:腾讯云云服务器(CVM) 产品介绍链接地址:https://cloud.tencent.com/product/cvm
<div class="arrow">文本</div>
.arrow {
position: relative;
width: 100px;
height: 100px;
background-color: #f00;
color: #fff;
text-align: center;
line-height: 100px;
}
.arrow:before,
.arrow:after {
content: "";
position: absolute;
width: 0;
height: 0;
border-style: solid;
}
.arrow:before {
border-width: 10px;
border-color: transparent transparent transparent #f00;
top: 50%;
left: -20px;
transform: translateY(-50%);
}
.arrow:after {
border-width: 10px;
border-color: transparent #f00 transparent transparent;
top: 50%;
right: -20px;
transform: translateY(-50%);
}
推荐的腾讯云相关产品:腾讯云对象存储(COS) 产品介绍链接地址:https://cloud.tencent.com/product/cos
<div class="line">文本</div>
.line {
position: relative;
width: 100px;
height: 2px;
background-color: #f00;
color: #fff;
text-align: center;
line-height: 2px;
}
.line:before {
content: "";
position: absolute;
width: 100%;
height: 2px;
background-color: #f00;
top: 50%;
transform: translateY(-50%);
}
推荐的腾讯云相关产品:腾讯云云数据库 MySQL 版(TencentDB for MySQL) 产品介绍链接地址:https://cloud.tencent.com/product/cdb
没有搜到相关的沙龙
领取专属 10元无门槛券
手把手带您无忧上云