The background image gets cropped when I zoom in

Currently, I am in the process of working on a project that utilizes bootstrap 3.3.7. The front page features a prominent background image.

The image appears perfectly on my computer screen like this: https://i.sstatic.net/faDRw.png.

However, when I try to Zoom In on the image, it ends up cutting off from the top and bottom like so:

https://i.sstatic.net/MHptc.png

The HTML code snippet responsible for displaying the content is as follows:

<div class="bg-img">
    <div class="container" style="color:#fff;padding: 56px 0 85px 0px">
        <h1 class="container" style="font-size:51px;font-weight:600;margin-bottom:30px;">Work Different</h1>
        <div class="row container" style="margin-bottom:12px;">
            <p class="col-md-3" style="width:29%">Provide your organization a powerful work execution platform that offers exceptional speed to business value — so you say yes to more ideas, more customers, and more revenue.</p>
            <p class="col-md-9"></p>
        </div>
        <br>
        <br>
        <div class="container"><a class="btn nav-btn-green" href="/SignUp">Try Risk Hippie for Free</a></div>
    </div>

</div>

The CSS style applied to my background image is as follows:

   .bg-img {
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;
    background-image: url(/img/newbackground.png);
    margin-top:-9px;
    -webkit-box-shadow: inset 25px 0px 25px -25px rgba(0, 0, 0, 0.45), inset 567px 0 170px -25px rgba(0, 0, 0, 0.45);
    -moz-box-shadow: inset 25px 0px 25px -25px rgba(0, 0, 0, 0.45), inset 567px 0 170px -25px rgba(0, 0, 0, 0.45);
    box-shadow: inset 25px 0px 25px -25px rgba(0, 0, 0, 0.45), inset 567px 0 170px -25px rgba(0, 0, 0, 0.45);
}

Unfortunately, I have encountered an issue where the image does not respond well when I attempt to zoom in using my browser.

Answer №1

When setting a background image size, consider using "auto" for specifying dimensions.

.bg_img{
        background-size: auto;
    }

Answer №2

Give this a shot:

.bg_img{
    background-size: cover; background-repeat: no-repeat;
}

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

Both paragraphs are on the same line

.footer { position: fixed; left: 0; bottom: 0; width: 100%; background-color: #3498DB; color: white; text-align: cent ...

Ext.ux.TDGi.iconMgr is a cutting-edge plugin designed specifically for the latest version of

Has anyone successfully migrated the Ext.ux.TDGi.iconMgr plugin to ExtJS 4? (http://tdg-i.com/44/extuxtdgiiconmgr...-icons-and-css) ...

How to Utilize CSS to Retrieve the Background Color in QTP

https://i.sstatic.net/xO8de.jpgCurrently, I am in the process of automating an application with a status bar that turns green when certain tasks are completed. However, I am facing an issue with QTP's Object Spy as it does not display the Color proper ...

Instant CSS transformation occurs on Safari browser

I am new to coding and trying to learn on my own. I want my code to work smoothly across all popular browsers, starting with Safari. Currently, the -webkit-transition: transform 1.0s; property in my CSS code works instantly in Chrome but not in Safari. Not ...

A step-by-step guide to implementing Google Analytics Event tracking using PHP

Implementing Google Analytics Events in Javascript can be done using the following code: ga('send', 'event', 'test', 'test','value'); I am trying to incorporate this feature throughout my entire project. ...

It is not possible for ReactJS to disable a button that has been created dynamically

Incorporating ReactJS, I dynamically generate a form using customized JSON data. render() { return ( <div> <ShowForm src={this.state.data} /> </div> ); } After updating with componentDidUp ...

Add Your Logo to the Navigation Bar using CSS

Can someone please assist me with adding a logo to my CSS navbar? I am struggling to figure out how to do this and would appreciate any guidance or tips on how to successfully implement a logo in the navbar. body { margin: 0px; } ul { list-style-ty ...

JavaScript animation for sequencing traffic lights

I have been working on completing a task that was assigned to me. (iii) Explain the organization of an array that could manage the traffic light sequence. (iv) Develop a script that utilizes the array outlined in part (iii) to create an animated display ...

Is there a way to prevent users from downloading a PDF link in HTML?

Is there a way to prevent the PDF toolbar from showing up in the browser whenever I open a PDF document? Specifically, I want to restrict users from being able to download the PDF file. My objective is to eliminate this toolbar: https://i.sstatic.net/qv ...

How can you generate a distinct id value for each element within an ngFor iteration in Angular 4?

I encountered an issue where I must assign a distinct id value to each data row within my *ngFor loop in angular 4. Here is the code snippet: <div *ngFor="let row of myDataList"> <div id="thisNeedsToBeUnique">{{ row.myValue }}</div> & ...

JS filter function is not functioning as expected. It's unclear what the issue might be

Check out my previous inquiry What could be the issue with my filter? I've implemented a filter, but it seems to have some glitches when dealing with specific values. The 'No Record Found' message doesn't appear as expected in certain ...

Create a dropdown menu in jQuery by using the prepend trigger

I'm attempting to utilize jQuery to prepend a trigger to a menu and then have that trigger toggle child elements. Unfortunately, the code below is not opening the sub menus when using jQuery prepend. Can anyone provide a suggestion for a fix? HTML & ...

Having trouble with jQuery field validation not functioning as expected?

I'm trying to implement user input validation when the submit button is clicked, but I can't seem to get it to work. Using jQuery $(document).ready(function() { function validateForm() { if ($('#u').value() == '') ...

Tips on using jQuery to check if two cards have matched

I have been working on a card matching game using jQuery, and I've encountered an issue. Even though I have written the code to compare two sets of cards, it always goes to the "card match" condition, even when the cards do not actually match. If you ...

Columns in the grid layout that do not include floated elements

I have a challenge of arranging seven columns of equal size in one row: .seven-cols .col-hard-1 { width: 14.28%; *width: 14.28%; float: left; } However, the use of float:left is causing issues with the following blocks on the page. Is there an alte ...

Showing a 2D array in HTML using ngFor loop

I need to display a list of arrays in an HTML p-table. Here is the array list: [Array(2), Array(2), Array(2), Array(2), Array(1)] 0: (2) ["abc", "def"] 1: (2) ["ghi", "jkl"] 2: (2) ["mno", "pqr"] ...

Display badges alongside Bootstrap pills while hiding any non-badge text when viewing on a mobile device

I'm working on a multi-step form using angular UI router and have a bootstrap nav at the top. However, on mobile-sized screens, each pill in the nav occupies its own line due to the amount of text. I want the non-badge content of each pill to disappea ...

The color of the letters from the user textbox input changes every second

My task is to create a page where the user enters text into a textbox. When the user clicks the enter button, the text appears below the textbox and each letter changes color every second. I am struggling with referencing this jQuery function $(function() ...

Issue with Attaching Click Event to Dynamic Div Elements

I've implemented divs with a Click Event triggered by a value entered in a text box. See an Example Here Upon opening the page, clicking any rows will trigger an alert. However, if you change the value in the text box (Enter Number) and click load, ...

Adjusting div to not be absolutely positioned

Trying to create a div with animated borders, but it only works when positioned absolutely in the center. For illustration, here is the HTML and CSS code: .bb, .bb::before, .bb::after { position: absolute; top: 0; bottom: 0; left: 0; right: 0; ...