![]() If you’re like me, then you will eliminate the white space around an icon to ensure the smallest file size possible. The map icon is narrower than the avatar icon which is narrower than the cart icon. Icons can take up varying amount of space depending on what we’re communicating. We also know that is not always a practical rule. ![]() That tells us exactly how much space we’re dealing with and makes alignment a breeze. Let’s say all the icons in a set are 100px square. Here’s an ideal situation: all icons are the exact same size. #Add refresh icon plus text button css code#Your code will much more maintainable and your designer (or your inner designer) will thank you. The lesson here: choose one format for all icons and use that as the basis for how you will approach aligning them to text. The beauty of something like SVG is that it is scalable by nature and affords you the ability to reply more on CSS to help align things rather than the design process. That means the icons are pretty much set at fixed dimensions (unless you start large and use background-size to scale down) and it would be much easier to adjust the size and line-height of your content to match that of your icons. Let’s say all your icons are contained in a sprite. ![]() Regardless of your preference (cough, SVG, cough!), the format of your icons will have a lot to do with how you align them to text. There are actually quite a few methods, if you include ones that might be considered old, as in, “That’s soooo 2011!” A few examples: I take for granted that there are other ways to do icons other than SVG. Tip 1: Decide on an icon format and stick to it Thankfully, there are a few universal tips we can put to use to ensure our icons always line up beautifully with text. However, there’s much more to finding the perfect alignment between icons and text. I have to be honest and say that I thought this would be a simple question to answer and one that could be done in a tweet. Tricky, right? Aligning icons can be a tough task especially if you are not the one charged with designing the icons. #Add refresh icon plus text button css how to#Here’s an excellent question that comes up often along those #smashingconf any recommendations on how to align #svg icons to text? Once you’ve decided on a format (SVG or icon font?) and designed the set, there are still other considerations, many of which pop up while you’re coding. ![]() They help complement content ( most of the time). ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |