Search code examples
htmlcssresponsive-designmedia-queries

What is the best way to fit all the elements of an HTML website using CSS?


I'm learning about CSS and HTML and I decided to create a simple website that just takes a phone number and redirects it to the whatsapp API website in order to avoid adding too many phone contacts when you buy/sell things.

I've started this little project on a github page:
https://frenchiveruti.github.io/wppapi/
And here's the source:
https://github.com/frenchiveruti/wppapi/tree/gh-pages

I'm having issues making a good adaptive design for the site in order for it to look "decent" in a mobile phone. Particulary I managed to at least find the @media query of my phone, but it displays all the elements in a very small and unuseful way.
Here you can appreciate what I get: Actual website look on a Xiaomi Mi A1 phone And what I would like (I have to "zoom in") in order to get this: enter image description here I will deal with the "margins" of the parts when I get there.


Solution

  • Add <meta name="viewport" content="width=device-width initial-scale=1.0" /> in the head tag - this will prevent the website from zooming out.