css实现标题左右横线_JED'S BLOG-CSDN博客

直接上代码

<div class='title'>快来设置吧</div>
.title {
  position: relative;
  font-size: 32px;
  color: #fff;
  height: 45px;
  line-height: 45px;
  text-align: center;
  top: 60px;
}
.title:before {
  content: "";
  position: absolute;
  width: 28px;
  height: 2px;
  top: 50%;
  background-color: #fff;
  left: 32%;
}
.title:after {
  content: "";
  position: absolute;
  width: 28px;
  height: 2px;
  top: 50%;
  background-color: #fff;
  right: 32%;
}

效果图

效果图


原网址: 访问
创建于: 2020-03-01 19:25:04
目录: default
标签: 无

请先后发表评论
  • 最新评论
  • 总共0条评论