1

<div class="heading"> <p>Hero<br> <span style="font-size:20px;">Banner</span><br> Text</p> </div>

const elements = document.body.querySelectorAll("*[style]") elements.forEach(element=>{ if(element.style.fontSize){ const {value: size, unit} = element.attributeStyleMap.get('font-size') element.attributeStyleMap.set('line-height', CSS[unit](Math.floor(size * (8.4/7.56)))) } })

.heading { font-size: 8.4rem; line-height: 7.56rem; }

I am able to remove the white space below the span tag but not able to remove the white space above the span tag. Kindly help

`<div class="heading"> <p>Hero<br> <span style="font-size:20px;">Banner</span><br> Text</p> </div>` `const elements = document.body.querySelectorAll("*[style]") elements.forEach(element=>{ if(element.style.fontSize){ const {value: size, unit} = element.attributeStyleMap.get('font-size') element.attributeStyleMap.set('line-height', CSS[unit](Math.floor(size * (8.4/7.56)))) } })` `.heading { font-size: 8.4rem; line-height: 7.56rem; }` I am able to remove the white space below the span tag but not able to remove the white space above the span tag. Kindly help

1 comments