Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Website, elements suddenly stops at 400px width

My page. Elements suddenly stops at 400px width. When you open DevTools in responsive mode and change the size under 400px width, elements stays at this specific width and wont get smaller. My question is why? I think there is one element which "breaks" this for all other elements, but I cant debug which one (or more) it is. HTML tag from this point starts to shrink and not getting 100% of website width. This website is still in development.

HTML tag is set to:

box-sizing: border-box;

I tried to set a fixed width size for a few elements that I thought were causing this. Of course It didnt help…What Am I missing?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

The 1 element which "breaks" this for all other elements is… div.home-services-container inside div.smaller-services-section
it has

grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
padding: 5em;

if you go to Computed (next to Styles) tab inside Chrome DevTools where you inspect elements you’ll find that this padding: 5em tanslates to a padding of 50px on the left and 50px on the right. Adding this to the 300px (from minmax(300px, 1fr)) we get our 400px

Hope this helps. Good luck with development!

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading