PricingBlog

SVG cuts a pixel from the icon.

  • uunicode-1277189391265038439

    unicodes

    1 year ago

    As you can see, adding an SVG cuts a pixel from the icon. I tried to add a padding to the SVG, or to the DIV but it continue to cut a pixel from the image. Do you know how to fix it?
    1277189391613296690-Screenshot_2024-08-25_at_11.52.41.png
  • uunicode-1277191467097391188

    unicodes

    1 year ago

    The solution I found now is adding in height a pixel more. ex. if the icon is 10x10, if you add 10x11 it will fix the problem but this means that it will go out of your design. I found this issue with all my icons. Outside toddle, the icon 10x10 works fine and perfect but here I have to add a pixel more.
  • tomthebigtree-1277247320320380949

    Tom Ireland

    1 year ago

    Have you tried adjusting the viewBox attribute for the SVG element e.g. 0 0 10 10 or whatever it should be?
  • lucasg-1277268816732360715

    Lucas G

    1 year ago

    Yeah the size should be set to the svg attributes not as width/height properties