Issue with CSS background scaling bug

Is it possible to make the cloud background scale within the box?

The current issue can be viewed here:

I have tried various methods to resolve the problem where the background scales even beyond the limited box. However, I could not identify the solution. I am uncertain if achieving this is feasible.

The HTML code used:

<div class="backgroundbox">
    <div class="box_animation"></div>
    <ul class="nostyle inline center">
        <li class="bboxcontent left">Freecns Cumulus includes over 100 weather specific icons that are provided in PNG, PDF, EPS, and SVG formats. <br /></li>
        <li class="bboxvideo"></li>
    </ul>
</div>

and CSS code used:

.backgroundbox {
  position: relative;
  z-index: 0;
  height: 295px;
  width: 816px;
  border-radius: 16px;
  margin-top: 48px;
  margin-left: auto;
  margin-right: auto;
  background: url('http://www.yanlu.de/files/images/CloudBG.png') no-repeat center;
  padding-top: 81px;
}
.bboxcontent {
  width: 295px;
  font-family: HelveticaNeue-Light;
  font-size: 18px;
  color: #FFFFFF;
  line-height: 22px;
  text-shadow: 0px 1px 2px rgba(0,0,0,0.75);
  margin-right: 8px;
  display: table-cell;
  vertical-align: middle;
}
.bboxvideo {
  height: 214px;
  border-radius: 4px;
  border: 4px solid #FFFFFF;
  color: #FFFFFF;
  -moz-box-shadow:    0px 1px 2px 0px rgba(0,0,0,0.75);
  -webkit-box-shadow: 0px 1px 2px 0px rgba(0,0,0,0.75);
  box-shadow:         0px 1px 2px 0px rgba(0,0,0,0.75);
  margin-left: 8px;

  display: table-cell;
  vertical-align: middle;
}
.box_animation {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
  background: url('http://www.yanlu.de/files/images/CloudBG.png');
  -webkit-background-size: cover;
  -webkit-transition-property: -webkit-transform;
  -webkit-animation-name: scale; 
  -webkit-animation-duration: 40s; 
  -webkit-animation-iteration-count: infinite;
  -webkit-animation-timing-function: linear;
}

Answer №1

To address your issue, you can apply the CSS property overflow: hidden; to the .backgroundbox class. This will cause it to conform to the dimensions of your box.

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

React Icons and Browser Tab Alerts

Is there a way to incorporate notifications into my website's favicon when the browser tab is not in focus? My tech stack includes React, Material UI, and TypeScript. I assume this is a frequent requirement, yet I haven't come across a simple so ...

Is there a way to ensure that the 'pointermove' event continues to trigger even after the dialog element has been closed?

I am working on a project that involves allowing users to drag elements from a modal dialog and drop them onto the page. I have implemented a feature where dialog.close() is called once the user starts dragging. This functionality works perfectly on deskto ...

Place a vertical slider adjacent to an HTML element on either the left or right side

I'm struggling to bind a range slider to the left or right side of a canvas that displays video. Despite my efforts, CSS seems to be putting up a strong fight. I can handle issues like stretching and slider values, but attaching it to the canvas is pr ...

Another date selection option missing from the available choices

I stumbled upon this template: . I am facing an issue where the second div I added does not display the dates, months, and years when duplicated. Here's a snippet of the script: <div class="form-date"> <label for="birth_dat ...

Using jQuery to alter the background position of multiple backgrounds in CSS

I'm using jQuery to dynamically adjust the background image position of an element based on screen resolution. Here's the code: var pwwidth = $(window).width(); var pwheight = $(window).height(); var bg1posx = pwwidth - $('h1.portofolio&ap ...

My efforts to resolve the issues in my code have been ongoing, but unfortunately, I have been unable to find a solution

I'm struggling to insert my contact form code into the contact tab without it interfering with the tab bar. I want the form to appear in the middle of the page when the tab is clicked. I've tried various placements for the code but none seem to ...

Elevated Floating Button

I am attempting to create a vertical floating button for my website, but the text is displaying outside of the box. CSS #feedback { height: 104px; width: 104px; position: fixed; top: 40%; z-index: 999; transform: rotate(-90deg); -webki ...

How can I adjust iframe content to fit properly on a mobile device screen?

I am facing a challenge where I need to embed an iframe into an external website over which I have no control. The only thing I can specify is the size of the iframe on my own website. My goal is to ensure that the content within the iframe adjusts to fit ...

How can I create a new div element for every item in an array by utilizing JSX?

I am currently working on creating a div element for each item in an array using reactjs JSX. I wasn't sure how to tackle this, so I attempted the following approach: {results.map((element, index) => ( <div key={index} className={ ...

What is the best way to display Bootstrap dynamic tabs in a single row without them overflowing and requiring a scroll button to access all the tabs

Is there a way to dynamically display Bootstrap tabs? I want the content in the tab to show when the link is clicked, and also have a close button. I need the tabs to be aligned in a single row without wrapping down if they don't fit. Here's an ...

What is the best way to create a button with a dynamic background animation in React?

Looking to design a button with an animated background, possibly in gif or video format. An example of what I have in mind is the DOWNLOAD button on this website's main page: Ideally, I am hoping for a solution using React. ...

Enhance the color scheme of your collapsed or expanded Bootstrap NAV for mobile devices

Currently working on customizing the navbar using Bootstrap. I've been able to style it perfectly for both desktop and mobile devices in its initial state. The issue arises when attempting to style the navbar in its expanded and collapsed states on m ...

Loading elements of a webpage in a consecutive order

I am currently working on implementing a content slider within my Django application. The specific slider that I am using can be found at this link. One challenge that I am facing is the need to load close to one hundred 'contentDiv' pages, and I ...

Injecting CSS styles into dynamically inserted DOM elements

Utilizing Javascript, I am injecting several DOM elements into the page. Currently, I can successfully inject a single DOM element and apply CSS styling to it: var $e = $('<div id="header"></div>'); $('body').append($e); $ ...

Challenges encountered while using Selenium WebDriver to upload images

I'm having trouble adding an image as a normal attachment to an email (not as an inline image). When inspecting the HTML DOM with Firebug, I noticed there are two elements with xpath //input@type='file', which is due to the presence of two b ...

Expanding the width of a bootstrap dropdown menu

Looking for advice on how to expand the dropdown width? I have a row with two columns and some JavaScript that handles the dropdown functionality. The issue I'm facing is that I can't figure out how to adjust the dropdown width when it's se ...

IItemTransform and minified files that are already in use

Summary: IItemTransform is not triggered when a minified file already exists in the same directory as the original (non-minified) file. Issue Description The problem arises due to CSS relative image references, impacting both JavaScript and CSS files when ...

The -webkit-box-reflect effect vanishes during the transition

I need help with this issue: The image loses its reflection during the transition until it returns at the end. Any suggestions are appreciated! Thank you! .specials-box { width: 330px; margin: 50px 0; height: 500px; position: relative; ...

Incorporate CSS styling into ScalaHelpers

Is it possible to customize the CSS for Scala Helpers and remove certain text from the textfield? @inputText(advForm("weeknr")) @inputText(advForm("jaar")) @inputText(advForm("datum")) --------------------EDIT 1------------------ After applying my own ...

JavaScript: Retrieving the following element from the parent container

Is there a way to prevent the next element within the parent tag from being enabled or disabled based on a certain condition? HTML: <span> <input type="checkbox" onchange="toggleInput(this)"> </span> <input type="text" ...