fixed width and height responsive
help i want to add fixed with and height with my css grid lay out but the responsiveness is gone.
3 Replies
By definition, setting width and height makes it impossible for something to be responsive
Unless you mean that you want to keep a certain
aspect-ratio
You can have either responsive elements or fixed-width/height. Choose one :p
"Responsive" wed design is about having fluid/dynamic sized content. You don't know what your end user's viewport is so you make the content and let the browser decide how it looks. Flexbox and grid are designed to do a lot of the flowing-maths under the hood…assuming you use "generic" sizes like
flex-grow
or 2fr
. But once you try to micromanage the browser you'll have a bad time.