HTML CSS examples for CSS Property:border-bottom
Getting h1's border-bottom closer to text
<html> <head> <title>Position text underline with pseudo image</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> header h1 {<!--from w w w.j a v a2 s . c o m--> font-size: 42px; } header h1 span { font-size: inherit; position: relative; } header h1 span:before { content: ''; border-top: 3px solid red; font-size: inherit; position: absolute; width: 100%; bottom: 6px; } </style> </head> <body> <header> <hgroup> <h1> <span>GUITARRA</span> </h1> <h2>Profesor</h2> </hgroup> </header> </body> </html>