HTML
Browser comparison <div class="parent"> Hier kommt<br>ein mehrzeiliger<br>Text <div class="test">test</div> </div> <div class="parent2"> Hier kommt<br>ein mehrzeiliger<br>Text <div class="test2">test</div> </div>
SCSS
.parent, .parent2 { position: relative; width: 200px; background: rgba(0, 100, 0, .2); div { position: absolute; background: rgba(255, 0, 0, .2); } } .test { left: 0; top: 0; right: 0; bottom: 0; } .test2 { left: 0; top: 0; width: 100%; height: 100%; }
Script