Icon & SVG center

Comments

6 comments

  • Eric Krull

    Hi NeilUK,

    You can try the Flex stack, put the icon in it, set the flex stack to Horizontal Align: uk-flex-center.
    I don't know if this is the best way, but it works for me.

    Succes!

    0
    Comment actions Permalink
  • NeilUK

    Thanks Eric, 

    That does indeed work, but I wonder if there's a better way.

    By better, I mean using less stacks. At the moment I have some SVGs using Doobox's stack and I can just click to center it. The same with other icon stacks.

    0
    Comment actions Permalink
  • Eric Krull

    NeilUK,

    I always try to use as less stacks as possible, but I ran into the same problem as you did.
    Using the Flex stack is my only solution so far. I hope Lucas has a better solution....

    I'm guessing you have to click on the "advanced" function in the icon stack and use an id and a custom class... but I have no idea how to use that.... maybe you do?

    0
    Comment actions Permalink
  • Lucas Tsolakian

    There're many ways to do it, using the Flex stack is perfectly fine. You can also use the flex classes directly on the parent stack and save the use of multiple stacks, so for example you can add the icons into the Container stack then the related classes to the Container custom class field:

    uk-flex uk-flex-center
    0
    Comment actions Permalink
  • Eric Krull

    Lucas, NeilUK,

    I tried this custom class in the "advanced" / Custom Class field of the icon stack, works perfectly.

    Thanks.

    0
    Comment actions Permalink
  • NeilUK

    Many thanks to you both.

    It works perfectly!

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk