如何在CSS3中创建多色文本边框

时间:2018-09-11 02:06:19

标签: css css3 border

如何在css3中创建彩色文本边框或下划线:

enter image description here

2 个答案:

答案 0 :(得分:3)

试试看!

  

   

.box {
  text-align: center;
  position: relative;
  line-height: 100px;
  background: #fff;
  width: 300px;
  background: linear-gradient(to right, red 75%, blue 0) bottom/100% 4px no-repeat;
}
   <div class="box">Latest articles</div>

答案 1 :(得分:1)

.wrapper {
    border-bottom: 3px solid red;
    position: relative;
}

.wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    height: 3px;
    width: 30px;
    background-color: blue;
}