What could be causing my webpage to be responsive only in Responsive Design View and not in the browser?

I've been experimenting with my website using the Responsive Design View tool, and it's working perfectly fine (the window is responsive and all).

However, when I try to test it on Chrome, IE, or even Mozilla, the page becomes unresponsive. Do you have any thoughts on why this might be happening?

CSS:

@media screen and (min-device-width : 480px) and (max-device-width :  768px) {

  .main_container {
    width: 100%;
    font-size: 16px;
    line-height: 22px;
  }

  #header {
    height: 200px;
    background-color: tomato;
  }

  #stanga {
    width: 70%;
    float: left;
    background-color: green;
  }

  .dreapta {
    width: 30%;
    float: left;
    background-color: red;
  }

  footer {
    height: 150px;
    width: 100%;
    background-color: black;
    clear: both;
  }
} 

@media screen and (min-device-width : 767px) and (max-device-width :  1200px) {

  .main_container {
    width: 800px;
    margin: 0 auto;
    font-size: 16px;
    line-height: 22px;
  }

  #header {
    height: 200px;
    background-color: tomato;
  }

  #stanga {
    width: 650px;
    float: left;
    background-color: green;
  }

  .dreapta {
    width: 150px;
    float: left;
    background-color: red;
  }

  footer {
    height: 150px;
    width: 800px;
    background-color: black;
    clear: both;
  }
}


@media only screen and (min-device-width : 1200px) {

  .main_container {
    width: 900px;
    margin: 0 auto;
    font-size: 16px;
    line-height: 22px;
  }

  #stanga {
    width: 70%;
    float: left;
    background-color: green;
  }

  .dreapta {
    width: 30%;
    float: left;
    background-color: red;
  }

  footer {
    height: 150px;
    width: 900px;
    background-color: black;
    clear: both;
  }
}

Answer №1

It's important to distinguish between min-width and min-device-width, especially when designing for desktops.

Check out this link for more information

The "min-device-width" setting pertains to the width of the device, while the "min-width" attribute relates to the width of the browser.

@media screen and (min-width : 767px) and (max-width :  1200px)

Please take note that there are collisions occurring at 768px and 480px. These may need to be corrected to ensure proper functionality.

I made some edits to your fiddle here: View the updated version here

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

Most efficient method to upload numerous images without any lag

I have a website where images are loaded only when they are slightly below the viewport. This method allows the site to load initially without images and then determine which ones need to be loaded based on the user's viewpoint. When a user scrolls ...

Grab every piece of JavaScript code and styling from the HTML document and transfer it into a textarea field

Below is my code that extracts the JavaScript like this: src="assets/js/jquery.min.js" src="assets/smooth-scroll/smooth-scroll.js" I want it to look like this: (I believe my regex is incorrect): <script src="assets/js/jquery.min.js"></script> ...

1 in every 3 divs in jQuery, chosen randomly

Hey there! I have a fun project in mind - programming a "Rock Paper Scissors" game with the computer. The only issue is figuring out how to make the computer choose a random object after I pick one of the 3 options. Here's what I've come up with ...

What is the best way to align icons in the center alongside text or paragraphs using react?

I'm struggling with centering my icons like <GrTools size="30px"/> next to my text. It's causing some alignment issues with my styled components. Here is my JavaScript: <div id='paragraph' className="container"> ...

Displaying a carousel of cards with a stacking effect using CSS and React

https://i.sstatic.net/254kG.jpgI am looking to design a layout similar to the image provided, where cards are stacked on top of each other with three dots for toggling. Can anyone guide me on how to achieve this visual effect? ...

I'm looking to switch out the `~` to turn it into a URL for the backend, seeing as `<img alt="" src="~/media/Banner/plane.JPG">` is returning a 404 error

1. Received an HTTP Request and JSON response from the backend localhost:3000 (entered value using wysiwyg) { "Description": "&lt;img alt=&quot;&quot; src=&quot;~/media/Banner/plane.JPG&quot; /&gt;1 test berita&lt ...

What is the best way to create a transparent effect over a solid color using CSS in the following situation?

I have been using the spinner on this website "". Specifically, I am referring to the third one in the first row. When I apply it to my system, a solid color appears in the center of the circle. However, I want to make it transparent, but when I attempt ...

Display the datepicker beneath the input field

I successfully integrated the datepicker, but I prefer for the calendar to display below the date input field rather than above it. HTML5 <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv=" ...

What causes jQuery's .width() method to switch from returning the CSS-set percentage to the pixel width after a window resize?

After exhaustively console logging my code, I have finally identified the issue: I am attempting to determine the pixel width of some nested divs, and everywhere I look suggests that jQuery's .width() method should solve the problem. The complication ...

Ways to prevent a <a href> element with a class linked to javascript from behaving like a block element

I am currently facing an issue with formatting an inline navigation. The last link, which is associated with a JavaScript class, is causing the entire link to become a block element instead of aligning inline with the rest of the links in the navigation. ...

Adding a background image to a box in MUI is a simple task that can enhance

I've been attempting to include a background image in the Box component of mui, but I can't seem to get it to work. Here is the code I've been using: const Main = () => { return ( <Box sx={{backgroundImage:'images/cove ...

analyze and respond to inquiries

Imagine there is a question titled Q1 with four radio answer options: Q1: a) b) c) d) If you were using Python, what steps would you take to locate the question, choose one of the answers, and then submit the webpage? ...

The onchange event in the dropdown activates a function, however, there is no alteration observed in the three

I am attempting to create a dynamic display of a green or brown floor on a webpage using three.js, based on the selection from a dropdown list. However, I am encountering an issue where the floor images do not update even though the function is being execu ...

Display the scroll bar in HTML only when the content exceeds the maximum height

I am trying to display a scrollbar only if the content is larger than the specified max-height. However, it seems that the scrollbar is always enabled. <div style="text-align: left; font-size: 1.5rem; max-height: 7rem; overflow-y: auto;"& ...

Maintaining Element Position in Responsive Design when Window is Resized Using Absolute Positioning Inside Relative

I have 2 div elements. The first div is larger and has the position:relative property. The second div contains a set of boxes inside the first div and has the position:absolute property. As I resize the window to make it responsive, the height of the se ...

Guide to modifying the attributes exclusively of the external borders in Bootstrap tables

Is there a way to customize only the outer border of a bootstrap 4 table by changing properties such as border-color, border-style, and border-radius? I attempted to do so, but it seems that the properties are being overridden. Here is my code: <!DOCT ...

Output discrepancy detected in input tag functionality

I'm trying to create a function where, upon button click, the sum of values in two input texts is displayed, but no matter what values I enter, it always outputs 0. What am I missing? Since both inputs default to 0, their sum is also showing up as 0. ...

Using Angular to Bind Checkbox Value in Typescript

I have a challenge of creating a quiz where a card is displayed with 4 questions structured like this: <div class="col-md-6"> <div class="option" id="Answer1"> <label class="Answer1"> <input value= "Answer1" type="checkbox ...

Adjust sensor - CSS div size scaling based on proportions

I am working on a flexbox layout with three horizontal columns that I want to occupy the full size of the window without any scrollbars. In the middle column, there is a div that will display an A4 page. The dimensions should always remain proportionate, ...

Rearrange the order of items in the fancybox gallery

Typically, fancybox displays items in the gallery based on the order they are added in the HTML code. Is there a way to customize the order of items when they are opened in the popup, while keeping the original order when displayed on the page? The solut ...