Tips for adjusting image dimensions specifically for mobile viewing

My website's image sizes are perfectly set for desktop, but they do not appear responsive in mobile mode. Despite using Bootstrap, the images overflow the display size. How can I set different image sizes for mobile mode? The same issue applies to the Google Maps template. I have tried using media queries, but it did not work.

Below is my CSS:

@media(max-width: 400px) {
    #himage{width:200px;}
}

Here is my code:

@extends('master') 

@section('content') 

<div class="row" id="promotions"> 
    <div class="col-md-12" style="margin-bottom: 40px;">
        <h1 style="text-shadow: 0 2px 5px rgba(0,0,0,.9);color:white; font-weight: bold;">News feed</h1><br>  
        <h3 style="text-shadow: 0 2px 5px rgba(0,0,0,.9);color:white; font-weight: bold;">This month's promotion:</h3><br> 
        <p class="homeintro ">Set of Rick & Morty Pop! figures for $30.00 only! For details visit our <a class="shopp" href="{{ url('shop')}}" style="text-decoration: none;">Shop</a>. </p> <br> 
        <div class="col-md-6" id="himage">  
            <img src="{{ asset('images/rc.jpg')}}" width="500"> 
        </div> 
        <div class="col-md-6" style="margin-bottom:15px" id="himage">  
            <img src="{{ asset('images/mr.jpg')}}" width="500"> 
        </div> <br> <br><br>
        <div class="col-md-6 col-sm-6" style="margin:10px;" id="himage"> 
            <p class="homeintro ">Rick & Morty posters for $15.00 only!</p> <br>
        </div>
        <div class="col-md-6 col-sm-12" style="margin-bottom:20px;" id="himage">  
            <img src="{{ asset('images/rmpos.jpg')}}" width="500"> 
        </div> 
        <div class="col-md-6 col-sm-12" style="margin-bottom:20px;" id="himage">  
            <img src="{{ asset('images/rmpos2.jpg')}}" width="500"> 
        </div> <br><br>
        <div class="col-md-6 col-sm-6" style="margin:10px;" id="himage"> 
            <h3 style="text-shadow: 0 2px 5px rgba(0,0,0,.9);color:white; font-weight: bold;">Soon in our store.</h3> <br><br>
            <p class="homeintro ">Spider-Man Homecoming action figures!</p> <br><br>
        </div>
        <div class="col-md-6 col-sm-12" style="margin-bottom:20px;" id="himage">  
            <img src="{{ asset('images/sphome3.jpg')}}" width="500"> 
        </div> 
        <div class="col-md-6 col-sm-12" style="margin-bottom:20px;"id="himage">  
            <img src="{{ asset('images/sphome.jpg')}}" width="500"> 
        </div>
    </div>  
</div>


@endsection 

Answer №1

If you are using Bootstrap 4, remember to include the img-fluid class for images that need to be resized responsively.

(For Bootstrap 3, utilize the img-responsive class instead.)

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

Creating a full-width tab card with Bootstrap-Vue: A step-by-step guide

I stumbled upon something similar in the documentation for bootstrap-vue: A card with tabs: https://i.sstatic.net/HoVEC.png Now, how can I style the tabs to look like this: https://i.sstatic.net/dbsRj.png This is my current code: <b-card no-body ...

Tips for avoiding divs from overlapping when the window size is modified

When I maximize the browser, everything aligns perfectly as planned. However, resizing the window causes my divs to overlap. Despite trying several similar posts on this issue without success, I have decided to share my own code. CODE: $(document).read ...

The setInterval function for the automated image slider is experiencing issues and is not functioning properly

I am facing an issue where the third photo in the slider does not appear initially. Eventually, the slide fails completely, causing the photos to change rapidly. Strangely, after the slide fails, the third photo sometimes appears sporadically. I am puzzl ...

What is the technique for implementing a slide animation on hover to move a div identified by the class `box`?

How can I create a div element with the class of box that already has some transitions applied to it, and also include a slide animation on hover effect for the same div? .box { background-color: red; width: 70px; height: 70px; transition-propert ...

Shifting the second column will raise all content and hide certain elements

Whenever I attempt to preview my page on mobile devices, the second column on the right moves under the first column as it should. However, the issue arises when the entire content on my site is pushed up, rendering the text (TAXI) invisible. PC Here&apo ...

Shade the entire td column in different colors depending on the characteristics of th

I am working with a table and here is the code for it: <table> <thead> <tr> <th style="width: 40%; text-align: center; vertical-align: center;">Nr.<br> crt.</th> <th style="font-weight: bold; wi ...

Having trouble with displaying the logo on the navigation bar (using bootstrap and django)?

Hello, I am struggling to include a logo in my navbar and it's not being displayed. Despite researching similar queries from others, I still can't figure out why the image won't show up. I'm uncertain whether the issue lies within my co ...

Tips for aligning the image on the left side and the text on the right side in a vertical line

css .container{ height: 250px; padding 10px 0; } .col-left{ display: inline-block; background-image:url("support.png"); height:235px; width:300px; } .col-right{ display: inline-block; width:600px; } html <div class="containe ...

Is there a way to adjust the SVG level so that it aligns with the center of the polygon instead

Looking to align a simple svg icon for a dropdown button with the text in the button so that the centers match up. Currently, the icon is aligned with the bottom of the text instead. Here's the code for the svg: <svg xmlns='http://www.w3.org ...

Steps for accessing the `<img>` tag within an `<a>` tag to focus on the `<img>` element in Internet Explorer

How can I target the img tag inside an href tag to set focus on the <img> element? For example: <a href="#"><img class="img1" src="abc.png"/></a> The CSS selector a .img1:focus {} does not seem to work. I am unable to access the ...

Struggling with transitioning from table layout to CSS, specifically encountering difficulty in aligning all elements properly

Back in the "good old days," we used to simply put everything into td cells and it would all line up perfectly. Now, with CSS, things are a bit more complicated. I'm struggling with how to achieve a specific layout. What I want is to have text on the ...

What is the best way to incorporate web components into a React Js project?

I am currently unfamiliar with web components. My main goal is to integrate Google Material Components into my React.js project. Google Material Web Component can be found here: https://github.com/material-components/material-components-web Is there a ...

"Placing an image at the bottom within a DIV container in HTML

My goal is to neatly align a group of images at the bottom of a fixed-height div. The images all have the same height and width, making the alignment easier. Here is the current structure of my code: <div id="randomContainer"> <div id="image ...

Jquery and CSS behaving in an unexpected manner

Here's a piece of code that I need some help with. The issue occurs when clicking on a box to expand it and display more information. Most of the time, it works fine, but occasionally if an image is not cached, clicking again to minimize the box cause ...

Tips for updating content within two separate tabs using jQuery

By default, the home tab is displaying blank as per the code below. Content will only appear when the product ordering tab is clicked. I initially implemented this logic in JavaScript, but encountered issues when trying to replicate it in jQuery. Can anyon ...

What is the best way to prevent the registered symbol from showing an underline?

I need help figuring out how to display part of a word with an underline, and part of it without. Specifically, I want the "registered" symbol to not have an underline. Here is the HTML code snippet: <h3>Basecamp<span class="sup">&reg;< ...

Tips for including a verification symbol next to your username

How can I implement a verification badge next to a user's username on a website using jQuery, JavaScript, PHP, HTML, and CSS? Currently, I am using isset($user[verification]) to display the badge, but I believe this approach is not optimal as it requi ...

Customize your QTabBar icons with Qt Stylesheet: Adjusting the icon mode

I am currently working on customizing a QTabBar with a stylesheet in my tool. I use QIcon to create icons for the tabs, allowing me to set different modes such as normal, disabled, and selected. The challenge I am facing is trying to apply a global stylesh ...

Manage the individual style properties for the background images of a single div

I have a DIV that I would like to have 2 or more background images displayed. In the DIV class, I defined a style with two image URLs: .manyImages { background: url(/a1.png), url(/a2.png) no-repeat; } <div class="manyImages"> </div> My ...

What is the best way to style my navigation bar using HTML and CSS?

Exploring the world of web design as a recent enthusiast, I delved into the basics some time ago only to forget them shortly after. My interest reignited a few months back, leading me to create my own web pages for practice and skill enhancement. However, ...