#underline { position: relative; font-size: 30px; margin: 50px 0 20px 30px; } #underline:after { position: absolute; bottom: 10px; left: 0; z-index: 0; content: ''; width: 210px; height: 10px; background: rgba(210,50,14,0.5); } #underline02 { position: relative; font-size: 30px; margin: 50px 0 20px 30px; } #underline02:after { position: absolute; bottom: 0px; left: -10px; z-index: 0; content: ''; width: 270px; height: 35px; background: rgba(10,150,14,0.3); }