Is the layout optimized for mobile devices?

I am attempting to design a mobile-friendly layout using CSS and HTLM5.

In my styles, I have included the following code at the end:

 @media only screen and (max-width: 480px) {
    body {
        padding: 5px;
        background-color:#FFF;
        background-image:url(images/smoothieworld_logo_mobile.jpg;
        background-repeat:no-repeat;
    }
    #wrap {
    with:auto;
    margin-top:80px;
   }
   #masthead, sidebar {
    display:none;
   }
   #mainnav {
    height: auto;
   }
   #mainnav li {
    float:none;
    width: auto;
    text-align:left;
    border-top: 1px grey solid;
    border-bottom: 1px grey solid;
   }
   #maincontent {
    float: none;
    width:auto;
    background-color:white;
   }
   #footer, #footer p {
    clear:none;
    width:auto;
    height:auto;
    background-image:none;
    padding-top:20px;
    margin-top:0px;
   }
   }

Unfortunately, this setup is not functioning properly in Safari and Firefox, even though they are both updated versions.

To address this issue, I appended a script below the links to my stylesheets like this:

<link  rel="stylesheet" media="screen" href="reset.css" type="text/css"  />
   <link  rel="stylesheet" media="screen"  href="base.css" type="text/css"  />
   <script scr="modernizer-2.6.2.js" type="text/javascript"></script>

However, when I resize my browsers, the preview of my layout remains incorrect.

Could someone please guide me on where I might be going wrong?

Answer №1

Remember to include this in your thoughts.

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

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the best way to overlay several hidden links on a single image using HTML?

Currently working on a project using Flask and I am interested in creating an interactive image where clicking on different sections will navigate to unique links. Is this achievable? Any guidance or resources on how to implement this feature would be mu ...

Implementing JavaScript to assign a symbol to several <span> elements with identical ids

I have a looping span element on my page that is generated based on the number of records in a database table. The appearance of the span can vary, displaying either one or multiple instances. Each span has the following structure: <span class="add-on" ...

The issue with properly filtering a nested JSON object within an array in JavaScript

I am currently working on integrating a search input filter inside a dropdown menu that contains nested dropdown list items. The JSON data I receive from the API response is as follows: API response glPlmAsmt.category = { "page_size": 100, ...

Troubleshooting the failure of the fetch function in my React application

Currently, I am delving into full-stack development with a focus on Js, React, and Express coupled with a Postgres database. The server is configured to run on localhost:5003, and the backend app.js file contains the following code: const express = require ...

Limit certain website functions exclusively for members

I am currently working on a website that offers a set of basic features for all users, along with some exclusive features reserved for members. For example, all visitors can read posts, but only members have the ability to add tags, share posts, and more. ...

Utilize PHP to incorporate a dynamic JavaScript navigation menu

I'm giving this question another shot, so please be patient with me. How can a JS menu be included in a PHP page? Every time I use an include statement for nav which contains HTML, nothing appears. index.php includes a statement that should fetch t ...

Interact with the screen by moving your mouse or sw

I am absolutely intrigued by this captivating visual effect. My goal is to implement this on an iPhone or iPad using touchmove functionality. Is there anyone out there who can assist me with this task? Here is the JavaScript code snippet: $(document).bin ...

Identify the nested Object within the Json data

I am looking to add and name a nested object within my Json data structure. The current structure of my Json is as follows: { "MH": [ { "MHF46": "Ledig", "MHF60": "60", }, ...

React Native undefined check isn't functioning properly

When verifying data such as house number, street, city, etc., I noticed that if the city is undefined. I am wondering why my if statement does not work when trying to check if the city is undefined? ${typeof el.properties.city !== "undefined" ? el.propert ...

Establish the date input format specifically for vue-moment

I've been trying to use vue-moment for date formatting in my application, but I'm having trouble getting it to recognize the input format that moment.js should parse. The date format returned by my API is like this: 2019-01-01 24:00:00 GMT Here ...

Not all mobile browsers support centering, but regular browsers work flawlessly

For some reason, I am experiencing an issue with centering divs on mobile browsers. It works perfectly fine on normal PC browsers - no issues at all =D. However, the main content on mobile devices remains stuck to the left. I have tried multiple solutions ...

What is the process of adding a source map for a CSS minification script generated by a gulp task?

Currently, I am focused on optimizing CSS minification through the use of gulp. An issue arises when trying to debug CSS, as all stylesheets are contained within knx.dev.css. It is necessary to implement a solution that allows for easy tracing back to the ...

A guide on utilizing the createAutoCorrectedDatePipe and createNumberMask functionalities within vue using text-mask

I have recently started utilizing a fantastic Vue component known as text-mask. This tool provides a simple yet stylish solution for input masks, which I primarily use for formatting datetime and numbers. Following the documentation, I have managed to impl ...

The arrangement and presentation of div elements on a website

I am experiencing difficulties with the order of my divs and the buttons are not functioning properly. My goal is to display a div containing extensive content, and once a user clicks the begin test button located below the lengthy text, the content should ...

Unlocking two features with just a single tap

I am currently working on a website for a kiosk, where the site transitions like a photoslide between each section. To achieve this effect, I have added a layover/mask on the initial page. The layover/mask is removed using a mouse click function. This is ...

What steps do I need to take in order to resolve the routing issue with angular.js in my

Working on a mobile application with angular.js and firebase.js has been both exciting and challenging. Recently, I encountered an issue where the page refused to load properly because it was trying to access a peculiar URL file://file:///Users/patutinskij ...

Is it possible to integrate HTML into PHP code without using echo statement?

On my index page, I wanted PHP to verify if the user is logged in when it loads. If the user is logged in, the webpage content would be displayed. If not, it would show the login page for the user. Here is the PHP code for the check: <?php if ($_SESSI ...

tracking the number of new buttons pressed (HTML/Javascript)

As a novice in programming, I am currently tackling a task involving a table in otree that displays 256 unique buttons using Javascript. Each button reveals an icon when clicked, thanks to a straightforward function. Within this function, I have incorpora ...

Strange occurrences with HTML image tags

I am facing an issue with my React project where I am using icons inside img tags. The icons appear too big, so I tried adjusting their width, but this is affecting the width of other elements as well. Here are some screenshots to illustrate: The icon wit ...

I am having trouble getting my website to work offline using caching

My cache file is displayed below: CACHE MANIFEST # 2013-11-22 14:38:54735779 CACHE: ../../../../assets/img/background_01.jpg ../../../../assets/img/background_02.jpg ../../../../assets/img/background_03.jpg ../../../../assets/img/datepicker_icon.png .. ...