How to center button's content

I think I should really review some CSS topics. Could someone give me a light why are the contents inside the buttons not centering? They look awfully unaligned to the center. I tried anything I could remember ;-; Codepen: https://codepen.io/leoncelestino/pen/NWZwYgq (View in mobile mode for easier debug, 'cause I'm not yet done with the mobile, much less the desktop version)
No description
10 Replies
Alex
Alex5mo ago
You've set letter-spacing:.2rem for some reason; when I remove that, they center
Pi, a future fluent jp speaker
Without the letterspacing it gets ugly ._.)
Alex
Alex5mo ago
if it's just for the AC and the brackets, add a non-breaking space between them in the markup  
Pi, a future fluent jp speaker
that works thx On js does it counts as white space?
Alex
Alex5mo ago
yes, you would need to update the conditional in your js to check for A C if you were using it there, ditto for the brackets
Pi, a future fluent jp speaker
would it be fine to use regex to remove it or am I adding unnecessary complexity
Alex
Alex5mo ago
I don't see why you'd need to, but I also don't think it looks bad without the space, so... you could if you wanted, but it seems like an unnecessary step
Pi, a future fluent jp speaker
I would remove it so it don't bothers me when I deal with the calculator's logic
Alex
Alex5mo ago
the other alternative is to replace all the inputs with type="button" with actual buttons, then you can separate presentation from the value/action
Pi, a future fluent jp speaker
ic I did that it got a lot more better
Want results from more Discord servers?
Add your server