How to create multi-color text border or underline in css3 as bellow :
Asked
Active
Viewed 167 times
2 Answers
4
Try this!
.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>

Elroy Fernandes
- 303
- 1
- 3
- 13
-
1@SaadBhutto the pseudo element is useless https://jsfiddle.net/kestqj9f/2/ – Temani Afif Sep 11 '18 at 12:55
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;
}