NO BUG: The problem of displaying an icon with a link

Browser: Chrome 129.0.6668.90
OS: Windows

Hi bricks team,

I placed an icon inside the div and set a background color for the div. The problem is that if the icon has a link, its behavior changes and actually increases the height of the div.

If the icon is SVG, everything looks good in the builder, but there is a problem in the frontend.

in builder :

in frontend :

no link :

On the frontend, it is not a bug. It has something to do with the default display inline and vertical align for images/svg.

The easiest solution is to apply a display flex to the icon element.

1 Like

Hi Hosein,
Thanks for your report!

I agree with David. Set the icon to display: block or flex, and it’ll behave as expected.
Pure HTML: https://codepen.io/timmse/pen/PoMzgZE

Best,
timmse

1 Like