Search code examples
htmlcssresponsive-designmedia-queriesmobile-devices

Media Queries acting weirdly


I am using dream weaver to create a responsive about me page for my site (using the default about me template). When I use the dream weaver on-device previewing system, the page is fully responsive and on my iPhone it resizes perfectly fine to look like this: responsive preview

However, when I upload the code to the website, the page no longer becomes responsive. It simply looks the same as it does on my laptop (as shown below) nonresponsive preview

Why is this issue occurring?

The html page is this. If you need me to post the code here as well, please tell me. Your help is much appreciated :)


Solution

  • For media queries to work on small screens, you need to include the viewport meta element in the head of your document. E.g.:

    <meta name="viewport" content="width=device-width, initial-scale=1">