Image breaks out of container on mobile devices using Bootstrap 4

When I view my website on different phones, the image in my div jumps down and out of its container. It seems to be okay on some devices, but not on the Samsung Galaxy Note 9 for example. Despite trying various solutions to prevent this issue, such as using Bootstrap 4 and media queries, I have been unable to find the correct solution.

View the problematic image here


<section id="showcase" class="">
<div class="primary-overlay text-white">
    <div class="container">
        <div class="row">
            <div class="col-sm-6 text-center">
                <h1 class=" display-2 mt-5 pt-5">All companies in one place
                </h1>
                <div>

                    <p class="mb-0 lead">For private customers, Kyndia is an app that provides access and information about the companies you interact with, all in one convenient application.</p>
                    <br>

                    <p><em>Simply organized and completely free.</em></p>

                </div>

                <button type="button" class="btn btn-dark">
                    <i class="fab fa-apple"></i> Get it from Appstore</button>
                <a href="#news" class="btn btn-success" role="button"><i class="fas fa-envelope"></i> Subscribe </a>

            </div>

            <div class="col-sm-6 text-center">
                <img src="img/Start.png" alt="" class="img-fluid wow bounceInRight d-sm-block">
                <!--d-none och d-lg-block-->
            </div>
        </div>
    </div>
</div>
</section>

Answer №1

Consider incorporating the Max-Width attribute in your CSS code.

To expand it to encompass the entire viewport or container width, utilize the following:

max-width: 100%

Answer №2

Check out this CSS code snippet

#header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
}

#header h2 {
    font-size: 24px;
}

#header .secondary-overlay {
    background: #f9c423;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

}

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

Disable browser autocomplete for Material-UI TextField

I am currently using Material UI version 0.20.0 and I am facing an issue where I need to prevent the password from being saved for a user in a TextField. I tried adding props to the TextField with autocomplete='nope' since not all browsers suppor ...

The min-height property in CSS appears to be ineffective on Jelly Bean

In my current project developing an Android application, I have incorporated Webviews in certain activities and fragments. However, I encountered a perplexing issue when running the app on Jelly Bean (api 16 and 18) emulator - the css property min-height ...

Is there a way for me to make a local HTML page save text directly to a file on my computer?

Currently, I am working on a straightforward HTML+JavaScript application that is designed to be loaded from a local file and run within the user's browser. The main functionality of this app will be to enable users to input text into a textarea and sa ...

Ensure that the div spans the entire width of the page, prioritize maintaining the aspect ratio, but allow for variable

I have a dilemma with a div containing multiple elements. My goal is to make the div 100% in width, while also attempting to preserve the aspect ratio if feasible. Should the enclosed elements exceed the div's boundaries, then the height will adjust a ...

The CSS styling of Vuetify TreeView does not support text wrapping

I'm having trouble getting the long text in this CodePen snippet to break and wrap properly. It extends off screen, rendering the append button unclickable. I've experimented with various CSS rules but haven't found a solution yet. Check ou ...

JavaScript: Find options in a datalist that correspond to user input

One of the features I am working with is a text input that utilizes a datalist. The content of this datalist is populated dynamically using PHP: <input type="text" name="city" list="cities" id="city"> <datalist id="cities"> <?php ...

Objects shifting position as the browser window is resized or zoomed

I've scoured through numerous examples, but none seem to work for my specific situation. On my webpage, I have multiple tables nested within a <div>, which serves as a background element (as it doesn't cover the entire screen). However, whe ...

Issue with spacing between elements in Tailwind/Nuxt - elements appear too close together

There seems to be a spacing issue when using tailwind v3.4.3 on the Tailwind Playground, with extra space added between span elements. <div> <p> <span class="bg-slate-800">TEST</span> <span class="bg-oran ...

`Changing the background according to the page URL in React JS: A guide`

Looking to enhance my simple app with a few pages by changing the background color based on page URL using React.js. What I aim to achieve: If the pathname is /movies, I want the background color to be red. This is my current progress: import React, { ...

Updating a class within an AngularJS directive: A step-by-step guide

Is there a way to change the class (inside directive) upon clicking the directive element? The current code I have updates scope.myattr in the console but not reflected in the template or view: <test order="A">Test</test> .directive("test", ...

I receive an [object HTMLCollection] as the output

I am currently working on recreating a login page and I want it so that when the button is clicked, it displays the name you entered, but instead, it returns [object HTMLCollection]. My expectation was to have the name displayed as entered. var nombre ...

The hyperlink is malfunctioning once it has been extracted from the string

In my View, I currently have some HTML code. Here's an example snippet: <b>Some text</b> <p style="color:#337ab7"> Some other text <a href="~/Content/files/my file_form.pdf" style="font-siz ...

Explore through the absolute object in the console by scrolling down, similar to a

I have a collection of commands that are displayed in a console-like format using Angular. When a new command is added, it appears at the bottom and the overflow moves upwards to accommodate the new content. However, I am facing an issue where I can no lon ...

Is there a way to change TTF files into OTF format?

I am looking to utilize the @font-face feature and have my fonts stored in TrueType (TTF) format. Can anyone advise on how to convert TTF to OpenType (OTF) format? ...

The CSS infinite animation becomes erratic and sluggish after a short period of time

My website featured a banner with a series of thumbnail images that animated at different intervals and looped indefinitely. Initially, the animations ran smoothly, but after a few seconds, they began to slow down and lose consistency. To troubleshoot, I u ...

Struggling to make images wrap properly using flexbox

I've been struggling to get these images to wrap properly within my container. They keep overflowing beyond the designated width and I'm not sure if it's because I have paragraphs placed under each image. Any ideas on how to make 3 images ap ...

Exciting new animation feature in ng-repeat

I have implemented ng-repeat with custom styling and plan to expand the array by adding new items. Here is my code snippet: // Custom JavaScript code var _app = angular.module("userApp", []) _app.controller("usrController", function($scope) { $scope ...

How to Align Printed Output in Angular Components

I am a beginner in Angular and I am looking to display modal information. To print the data, I am using onclick=print(). The data shows up in the print preview, but it is not aligned correctly. Here is a screenshot of my page. I want to align the data prop ...

Creating a Cross Fade Animation effect with the combination of CSS and JavaScript

I've been attempting to create a similar animation using html and css. Below gif shows the desired outcome I am aiming for: https://i.sstatic.net/YsNGy.gif Although I have tried the following code, I have not been able to achieve the desired result ...

The video on mobile is not loading properly, as the play button appears crossed out

There seems to be an issue with GIFs not loading on mobile devices, even though they are implemented as mobile-ready. <video src="/wp-content/uploads/2017/09/5.mp4" preload="metadata" autoplay="autoplay" loop="loop" muted="muted" controls="controls" ...