NO BUG: Display: none - does not hide element wrapper and causes spacing issues

Hi Milan,
Thanks for the video and especially the link to the website!

Briefly summarized:

You insert an icon, set a link on the icon, and then set the display property to none. The result is that the icon is hidden, not the a-tag (the link) around it. Accordingly, the gap is still present, as the styles are still applied to the icon itself and not to the link, as in 99.9% of cases, you want to style the icon and not the link around it.

However, there is a straightforward and painless solution for this.

  1. remove the link from the icon.
  2. instead, wrap the icon with a div.
  3. change the HTML tag of the div to a[link] and set your link
  4. set the display property of the div/link to none

Result: no gap, because you apply the display:none value directly to the wrapper instead of the icon :slight_smile: