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

Modify PHP script to extract the Document Object Model (DOM) from a specified URL

Hey there, I'm currently using this code to extract and display the HREFs of all "A" tags from a URL. However, my output includes the entire link when I only want the name portion after http://twitter.com/namehere So, I'm looking to clean up my ...

Question: How can I use the jQuery datepicker to ensure that the selected date remains in the

I recently created a webpage using a combination of HTML, PHP, and jQuery. The PHP script is designed to load all data where the date matches the one selected in the text input field generated by the jQuery datepicker. However, I encountered a problem whe ...

Turn off automatic downloading of embedded frame content in Safari for iOS

I am encountering an issue with a modal that displays a PDF and offers two options - one to print and one to download. The download option uses a blob with content-type: application/octet-stream, while the print option utilizes a blob with content-type: a ...

Different techniques for using percentages in CSS transformations to create dynamic animations for DOM element translations

I have 14 objects positioned across the dom that I need to animate using the translate property. Currently, I am using transform: translate(x%, y%) for each object, requiring me to calculate the translation amount and apply a CSS style individually. This m ...

What could be causing appendChild to malfunction?

I'm having an issue trying to create three elements (parent and one child) where the third element, an <a> tag, is not appending to modalChild even though it's being created correctly. modal = document.createElem ...

Unable to display PHP response in a div using AJAX - issue persisting

Hey there! I'm currently working on a project where I want the form submission to load a response into a div without refreshing the page. I've looked at various examples of ajax forms with PHP online, but haven't been able to solve my issue ...

Can IE(7?) cause distortion of backgrounds from sprites?

This task is giving me a headache. We're almost finished with revamping our website. The last step involves consolidating all the glyphs and icons into a sprite. These images are transparent .png files, so we made sure the sprite maintains transparen ...

Incorporate a widget with dynamic height adjustment

We are currently working on creating a widget that can be easily embedded by third-party websites. Our goal is to have the widget automatically adjust its height through the embed script. Initially, we considered using an IFrame generated by our JavaScrip ...

Can you help me identify the issue with this code? It works fine when I don't include the dimensions, but as soon as I add them, the entire page disappears

After removing the dimensions, everything appears fine. But as soon as I add them back in, the entire page disappears. I'm struggling to understand why that is happening? $src = $row['product_image']; echo "<td>"."<img src="$src" h ...

Which is better: Utilizing Ajax page echo or background Ajax/direct HTML manipulation?

I am facing a dilemma and I could really use some guidance. Currently, I am in the process of developing an ordering system using PHP/Smarty/HTML/jQuery. The main functionality revolves around allowing sellers to confirm orders on the site. My goal is to ...

Enhance the appearance of the popover by incorporating an arrow-like element for dismissing the

Here is some code I want to modify: https://i.stack.imgur.com/0C61Y.png I would like to add an arrow element at the top, similar to this: https://i.stack.imgur.com/pDT3s.png This will give it a popup-like appearance. Below is the CSS styling for the co ...

How to make a routerLink clickable within an anchor tag in Angular 6

I am facing a peculiar issue with a group of hyperlinks. html <div class="col-12 navlinks"> <div class="text-center"> <div class="justify-content-center"> <a class="col-auto d-inline-block whitelink" rou ...

What determines the root element of the CSSOM (CSS Object Model)?

As I dive into my research on browser rendering, I've reached the stage in the rendering process where the browser creates the CSSOM from raw CSS. In many tutorials I've encountered, the authors confidently state that the body element is the roo ...

Customizing the size of dateBox icons in JQuery Mobile

Is there a way to increase the button size within the input box of a dateBox? Currently, it appears small and difficult to click accurately. Additionally, it would be beneficial if clicking anywhere in the input field could open the calendar, instead of ju ...

How do I return a <div> element to its initial state after JavaScript has made changes to it?

So, I have this situation where a DIV contains a form. After users submit the form successfully, I want to replace the form with a simple message saying "everything is good now". This is how I currently do it: $("#some_div").html("Yeah all good mate!"); ...

Issues encountered with the functionality of face-api and tensorflow.js within the browser

I've been trying to execute this example in the browser Check out the example here Specifically looking at this code snippet <!DOCTYPE html> <html> ... (Contents of the code snippet) ... </body> </html> Unfortunately, I&apos ...

Design and styling with HTML5 and CSS

Having a small issue with my code as I venture back into coding after a long hiatus, resulting in me forgetting some basics. Currently, I am attempting to create a simple HTML layout. Upon inspecting the page, I noticed that it appears slightly longer tha ...

The functionality of the .toggle method is limited to only being effective 1.5

I'm having an issue with making an image popup using the .toggle function in javascript. It seems to work initially, but then only works partially after that. When I click on the image, it opens as expected. However, when I try to close it by clickin ...

Avoid clicking in areas outside the perimeter of the blue circle in the SVG

Is there a way to restrict clicking outside the blue circle? The goal is to only allow opening by clicking on the svg itself, This includes everything, even white space inside the svg. How can this be achieved in the code? The current behavior is that ...

Aligning a block heading in the middle of the page

I developed a basic flex-based table. section { display: flex; flex-direction: row; align-items: stretch; width: 100%; margin: 0; background-color: green; } h2, ul { width: 50%; padding-left: 1.5em; padding-right: 1.5em; } h2 { tex ...