TheRandomCrew / TicTacToe-JS

A Tic Tac Toe game you can play in your browser!
https://raw.githack.com/Israel-Laguan/TicTacToe-JS/24623a2bc3f0764698f32103f8b48074abf91278/index.html
Apache License 2.0
1 stars 3 forks source link

Size of em #13

Closed arandamerinoalberto closed 1 year ago

arandamerinoalberto commented 4 years ago

https://github.com/Israel-Laguan/TicTacToe-JS/blob/9e364a84be1f8036185a08785785756461e73c20/src/css/main.css#L28

Why you have used the format em instead of px?

PD: Esto será una buena manera de practicar inglés en las issues. Estoy comenzando por mirarme el css e iré avanzando hasta llegar a Javascript. Línea a línea. Gracias Israel.

Israel-Laguan commented 4 years ago

Short answer

So the style can be more responsive. Using px is good on design but for support mobile, TVs and all the sizes in the middle, relative units are better.

Long answer

When you use em you are setting up against the base pixels informed in the browser. CSS compares the pixel unit given from the browser, and that is important because this can be different than "normal" pixels from 'px' units. By using em you ensure the pixel is relative to the user's browser.

Israel-Laguan commented 4 years ago

As a side note, is even better to use rem units, but you have to create a good design system behind!