DEV Community

Discussion on: 5 CSS interview questions one should know [part 2]

Collapse
 
facundocorradini profile image
Facundo Corradini • Edited

Hey Neha!

I appreciate the love for CSS, but those concepts could be better explained.

Box model is how the browser determines an element's dimensions, with the margins being a part of it too. It looks like you're answering "what is box-sizing" rather than the box model itself.
box-sizing is an important clarification to make when explaining the box model, but there's much more to it.

Mobile-first is not the concept of building responsive apps, but an approach to it. The idea is to start from the mobile layout and progressively enhance it for bigger ones. This allows us to reduce the computational requirements for mobile devices (that are supposed to be less powerful than desktop computers), and benefit from the browsers' defaults, as mobile layouts usually are boxy in nature.
Also media queries are not the only approach for creating the bigger layouts, as grid and flex allows some degree of adaptation themselves.

I agree 100% that taking out the visual indication of focus is terrible as it would pretty much block keyboard navigation users from using the website at all, but outline: none is not a bad practice on itself if you use it purposely and provide an alternate for it. For instance, the squary nature of outlines can look awful in buttons with rounded corners, so using outline:none on the :focus state and replacing it with a box-shadow (that follows the rounded corners instead) would be a great way to take care of accessibility without ruining the aesthetics.