DEV Community

Discussion on: What is a problem you constantly have with CSS, or something you keep wanting to learn how to do?

Collapse
 
ender_minyard profile image
ender minyard • Edited

Making icons center next to text. I use emojis because it's easy. For example, if I wanted to make a button that said upload image ๐Ÿ–ผ and use a custom icon, the icon is never vertically centered. Oh look, even the emoji isn't centered.

Collapse
 
5t3ph profile image
Stephanie Eckles

Both grid and flexbox can be defined as an "inline" variant which is great for both buttons or text within a paragraph. I would recommend flexbox as the slight advantage since its default alignment is along the x-axis (horizontal).

Here's a possible solution for both button-looking links and inline links - you could swap the link to a span and update the class names: