Firefox is causing an issue that does not appear in Chrome, Safari or IE11. When adding the display: inline
property along with the ::before
pseudo element to a heading element, it causes the bottom: 0
of the absolute positioned pseudo element to not appear at the bottom of the element but rather at the bottom of the first line.
This only shows on headings that span across multiple lines, does anyone know a work around for this for Firefox? All of the different display
property values do not make the pseudo element appear the same as the other browsers.
h1 {
position: relative;
display: inline;
}
h1::after {
position: absolute;
bottom: 0;
left: 0;
width: 0;
height: 5px;
content: "";
background-color: red;
transition: all .2s ease-in-out;
}
h1:hover::after {
width: 100%;
}
<div style="width:200px;">
<h1>My Heading That Covers Multiple Lines</h1>
</div>
CodePen: https://codepen.io/anon/pen/bXEjGg