h2 {
border-bottom: 1px dashed #999;
display: inline;
}
So you receive what you need.
But you have to keep in mind that <h2> is then (of course) no longer a block element. But you can “avoid” that by putting a <h2> in a <div>.
h2 {
border-bottom: 1px dashed #999;
display: inline;
}
So you receive what you need.
But you have to keep in mind that <h2> is then (of course) no longer a block element. But you can “avoid” that by putting a <h2> in a <div>.