2/18/2023 0 Comments Css force responsive resizeIn general, we could give that div a margin: 0 auto to center it. And that’s why we had to remove the max-width: 1000px, because since the parent don’t try to center it, it would be stuck on the left instead of growing all the way to the other side. That’s why we gave #pricing align-self stretch (which is the default value of align-items/align-self), thus the browser won’t give it any margin, making the child the biggest it can be and with the power to resize itself. What this cause is that every child will be the smallest it can be (min-width), so when you resize the browser window it won’t shrink anymore, it will create a scroll instead. Which means max-width will be ignored, actually, if you don’t give any width or min-width to a child, it would have 0 width and won’t show up. Your #main has a flex-direction of column and it align-items to the center, to align items to the center the browser will give the maximum it can of margin on the left and right to each child. I’ll try to explain but take it with a grain of salt because I also don’t understand it completely. The way your page is configured that’s causing some issues. You can remove table’s max-width (because it will need to grow) and replace #pricing auto margins in margin: 50px auto 30px auto to 0 or another value. Here is the CSS for the pricing container, which contains my three tables, and the CSS for the table element. Instead, my tables keep defaulting to whatever the min-width is set to, even though there is more room in the container. I would like my tables to be set at a standard width of 300px (flex-basis: 300px ) and grow and shrink to fill the container (min-width: 250px max-width: 350px ). I am almost done building my Product Landing Page, but can’t figure out one thing: how to make my three pricing tables grow and shrink.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |