h2 { position: relative; width: 250px; margin: 20px auto; padding: 10px; color: #ffffff; border-bottom: 3px solid #007db9; } h2:before { content: ""; position: absolute; left: 0; bottom: -3px; width: 70px; height: inherit; border-bottom: 3px solid #ffffff; } https://into-the-program.com/two-color-border/