skip to Main Content

Html – div with position: absolute gets the wrong width from the child image, in Firefox only

.div1 { position: relative; padding-bottom: 25%; background: lightcoral; } .img-container { position: absolute; height: 100%; background: green; } .img1 { height: 100%; opacity: 50%; } <div class="div1"> <div class="img-container"> <img src="https://placehold.co/600x300" alt="" class="img1"> </div> </div> Chrome result (expected result): Firefox…

VIEW QUESTION
Back To Top
Search