Before we come to how to style underlines, we should answer the question: should we underline? In graphic design, underlines are generally seen as unsophisticated. There are nicer ways to draw emphasis, to establish hierarchy, and to demarcate titles. That’s clear in this advice from Butterick’s "Practical Typography".
Full article