Removed elements still occupy space. Why? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Removed elements still occupy space. Why?

I have made a program https://code.sololearn.com/WIlKNDFPOMs3/?ref=app in which even after removing the elements(by clicking the × button) using jQuery, the space around them (possibly it is the space of margin-bottom) still persists.

23rd Jul 2020, 3:27 PM
Yashvardhan Singh
Yashvardhan Singh - avatar
3 Answers
+ 2
The problem is <br />, remove them and increase margin-bottom if you need more space between the alerts. https://code.sololearn.com/W6z2sGBKkmFS/#html
23rd Jul 2020, 6:43 PM
ODLNT
ODLNT - avatar
+ 3
They both are in two different divs. Clicking on X, makes display as none.So that element will be removed from the DOM and space will be allocated.
23rd Jul 2020, 6:08 PM
paperinflames
paperinflames - avatar
+ 2
Damn it was that easy... ODLNT thank you so much and paperinflames thanks for your help too ^^
24th Jul 2020, 3:38 AM
Yashvardhan Singh
Yashvardhan Singh - avatar