Tips on utilizing media queries to optimize website layout for mobile devices

I'm currently working on a responsive website and utilizing media queries for that purpose. However, I've encountered an issue where the media queries don't seem to apply when the browser window is set to mobile view. Below is the snippet of my CSS and HTML code. Can anyone help me figure out how to make these queries work properly? Specifically, I want the content to have a right margin whenever the browser width is less than 760px.

@media all screen and (min-width:410) and (max-width:760px) {
  .image2 {
    display: flex;
    flex-wrap: wrap;
    margin-right: 1000%
  }
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

<div class="container-fluid text-center">
  <h3 class="text1" style="margin-top: 30px; font-family: 'Fira Sans Condensed';font-size:60px;"> Multi Currency Wallet</h3> <br> <br>
  <div class="row text-center ">
    <div class="col-sm-4">
      <img src="Assets/img/deyapay.png" class="image2" alt="Paris" style="width:20%; height:30%;"><br>
      <h4 style="font-family: 'Fira Sans Condensed';margin-right:20px">deyaCoin</h4>
      <p style="text-align:justify; margin-left: 38%;float:left;">
        Get Paid instantly. The moment you sell something is the moment you get paid.</p>
    </div>
    <div class="col-sm-4">
      <img src="Assets/img/creditcard.png" class="image2" alt="New York" style="width: 25% ;height:30%;"><br>
      <h4 style="font-family: 'Fira Sans Condensed';">Credit/Debit</h4>
      <p style="text-align:justify; margin-left: 38%;float:left">
        we takes the user card details and process the payment transaction.
      </p>

    </div>
    <div class="col-sm-4">
      <img src="Assets/img/bank.png" class="image2" alt="San Francisco" style="width:20%;height:30%;"><br>
      <h4 style="font-family: 'Fira Sans Condensed';margin-right:30px;">ACH</h4>
      <p style="text-align:justify; margin-left: 38%;float:left">
        We collect the bank details and process your payment in secure manner.</p>
    </div>
  </div>
  <div class="row text-center">
    <div class="col-sm-4">
      <img src="Assets/img/group.png" alt="Paris" class="image2" style="width:25%; height:30%;"><br>
      <h4 style="font-family: 'Fira Sans Condensed'; margin-left: 20px;">Share Expenses</h4>
      <p style="text-align:justify;margin-left: 38%;float:left;">
        Jack, Jane and John go on a skiing weekend together. Jack pays for the ski-hire;Jane pays the hotel; John pays for dinner.</p>
    </div>
    <div class="col-sm-4">
      <img src="Assets/img/money.png" alt="Paris" class="image2" style="width:25%; height:30%;"><br>
      <h4 style="font-family: 'Fira Sans Condensed';margin-left: 10px">ReceiveMoney</h4>
      <p style="text-align:justify; margin-left: 38%;float:left;">
        You can request money among your family, friends, contacts, or split money among your contacts to receive money from.</p>
    </div>
  </div>
</div> <br><br>

Answer №1

Don't forget to include px in the min-width property and avoid using the all property.

Check out this fiddle:https://jsfiddle.net/6180Lub2/

    @media screen and (max-width:760px ) and (min-width:410px)  {
             .image2 {
            display: flex;
            flex-wrap: wrap;
            margin-right: 1000%
        }

          }


         
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
          <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
          <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

    <div class="container-fluid text-center">
          <h3 class = "text1" style = "margin-top: 30px; font-family: 'Fira Sans Condensed';font-size:60px;"> Multi Currency Wallet</h3> <br> <br>
          <div class="row text-center ">
             <div class="col-sm-4">
                <img src="Assets/img/deyapay.png" class = "image2" alt="Paris" 
                 style = "width:20%; height:30%;" ><br>
                 <h4 style="font-family: 'Fira Sans Condensed';margin-right:20px">deyaCoin</h4>
                <p style="text-align:justify; margin-left: 38%;float:left;" >  
                     Get Paid instantly.
                   The moment you sell something 
                     is the moment you get paid.</p>
              </div>
            <div class="col-sm-4">
                <img src="Assets/img/creditcard.png" class = "image2" alt="New York" 
                     style = "width: 25% ;height:30%;" ><br>
                <h4 style="font-family: 'Fira Sans Condensed';">Credit/Debit</h4>
                <p style="text-align:justify; margin-left: 38%;float:left">  
                  we takes the user card details
                  and process the payment transaction.
                </p>

              </div>
            <div class="col-sm-4">
                <img src="Assets/img/bank.png" class = "image2" alt="San Francisco" 
                style="width:20%;height:30%;"><br>
                <h4 style="font-family: 'Fira Sans Condensed';margin-right:30px;">ACH</h4>
                <p style="text-align:justify; margin-left: 38%;float:left">  
                We collect the bank details and
                process your payment in secure manner.</p>
              </div>
          </div> 
          <div class="row text-center">
             <div class = "col-sm-4">
               <img src="Assets/img/group.png"  alt="Paris" class = "image2" 
                 style = "width:25%; height:30%;" ><br>
                 <h4 style="font-family: 'Fira Sans Condensed'; margin-left: 20px;">Share Expenses</h4>
                <p style="text-align:justify;margin-left: 38%;float:left;" >  
                  Jack, Jane and John go on a skiing 
                  weekend together. Jack pays for the
                  ski-hire;Jane pays the hotel;
                  John pays for dinner.</p>
              </div>
              <div class = "col-sm-4">
               <img src="Assets/img/money.png" alt="Paris"  class="image2" 
                 style = "width:25%; height:30%;" ><br>
                 <h4 style="font-family: 'Fira Sans Condensed';margin-left: 10px">ReceiveMoney</h4>
                <p style="text-align:justify; margin-left: 38%;float:left;" >  
                  You can request money among 
                  your family, friends, contacts,
                  or split money among your contacts
                  to receive money from.</p>
              </div>
            </div>         
        </div> <br><br> 

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

Crafting a personalized arrow for sorting headers in Angular Material

Currently working on an Angular 5 project and I'm looking to implement a custom sort icon in the header. The goal is to achieve a similar effect to this example, without using the default arrow. I attempted to modify the CSS styles, but it wasn' ...

The clearfix feature is ineffective when using AngularJS

<ul class="dropdown-menu wm_search_div" ng-show="searchDivShow"> <li ng-repeat="user in searchUserList"> <a href="javascript:void(0);" class="wm_clearfix3"> <img ng-src="{{user.faceIcon}}" class="pull-left wm_se ...

A mysterious underscore suddenly materializes within Font Awesome icons when used in HTML

Currently, I'm working on the footer section of a webpage using HTML and Bootstrap 5.3.0. I encountered an issue where an underscore appears next to the icons when I add them. I suspect that this is due to the white spaces between the elements, which ...

Create containers on the right side using HTML

Struggling to align the small boxes on the right side while keeping the left boxes from blending under them? I've attempted various solutions, but each time it seems like the code breaks. By the way, I utilized a generator to create the grid. Here is ...

Switching images between mobile and desktop view in responsive mode is a useful feature for optimizing

Within a specific folder structure, I have a collection of images designated for both desktop and mobile displays: img: img-1.png img-2.png img-3.png img-4.png img-5.png img-6.png img/mobile: img-1.png img-2.png ...

Display a circular div containing information; upon hovering over it, reveal all details

Looking to create a layout with three circular divs side by side where the bottom of each circle displays the beginning of an information text. Upon hovering, the full text should be revealed: My initial approach involved setting the CSS properties for a ...

Safari not fully supporting CSS translate functionality

When I click a button on my app, an element slides into view and then slides out when I click the button again. This is achieved using a combination of CSS and JS. It works perfectly in Chrome and Firefox, but only partially in Safari. In Safari, the elem ...

What is the best way to make the Bootstrap navbar stay fixed at the top of the

I am currently experiencing an issue with the Bootstrap navbar while using version 5.0. Whenever the Bootstrap navbar expands, the content below it also moves down, which is not the desired behavior. I want the content to remain in place. I tried set ...

Stacking SVG elements can lead to distortion effects

Currently experimenting with the innovative SVG stacking method to integrate multiple icons into a single file, reducing the browser's HTTP requests. The details of this technique can be found in depth here. In essence, it involves placing numerous S ...

Creating a List Item with Equal Height as Its Parent Container

<nav> <ul id="navUl"> <li> <div class="settingsDiv"> hey </div> </li> </ul> </nav> I am trying to adjust the height of the div element to match the height of the nav. My g ...

Enhance Your YouTube Comment Section with CSS Styling

I am brand new to css html and I'm attempting to create a comment display system similar to that of YouTube using only CSS. My goal is to have an image of the commenter displayed, followed by their username and comment text listed beside it. So far, I ...

Ways to incorporate style links in Angular v2 components?

Currently, I am working through the Angular tutorial available on their website. In my quest to create various components, templates, and styles, I have hit a roadblock. The issue lies in incorporating my styles into the components using the 'styleUR ...

There are currently no articles found that match the search query

Recently, I started working with Django, but I am facing an issue with slug. Whenever I send a request to the Slug, I encounter an error. The error message I receive is: Articles matching query does not exist. Furthermore, I am facing another error while ...

What is the best way to create a grid layout that is responsive using HTML and CSS

I have been searching all over the internet and have not been able to find a grid layout like this. The "grid-template-columns" property is not achieving what I need, as I cannot make one box larger than the others. I am looking to create 4 equal boxes an ...

Utilizing jQuery for easy drag-and-drop functionality in web development

I have two lists which are currently using jQuery for functionality. An example can be found here. I need the same basic functionality but with some modifications: Instead of just getting all sortable items by clicking "Get items," I want to be able to dr ...

"Crafting dynamic buttons with ASP.NET and CSS that adapt to various

Looking for advice on making a popup responsive. Currently experiencing an issue where the buttons go off-screen when adjusting window size, even after using percentages in CSS instead of pixels. Any suggestions? CSS: .modal { display: none; posi ...

Problems revolving around the fundamental CSS drop-down menu concept

I'm struggling to center a CSS drop-down menu on my webpage without causing the drop-down effect to break. No matter what I try, it seems to mess up. What am I missing? Snippet of code: html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,b ...

What's the best way to link up rotated div elements?

I'm currently attempting to connect rotated divs at a 45-degree angle, but I'm struggling to find the solution. Here is the current state of the page: Here is a screenshot of the page: https://i.sstatic.net/jqPYJ.png This is what I am aiming f ...

showing sections that collapse next to each other

I am currently designing a portfolio website using HTML, CSS, and vanilla JavaScript. I have implemented collapsing sections that expand when clicked on. However, the buttons for these sections are stacked vertically and I want to place them side by side. ...

Adding clickable padding to a Draft.js editor can enhance the user experience and make the editing process

Is there a way to apply padding to the Draft.js Editor so that clicking on the padding area selects the Editor? If I add padding directly to the container div of the Editor, the padding displays properly but clicking on it does not enable writing in the E ...