Merge diverse backgrounds with Parallax Scrolling

My Parallax scrolling website has a div called "bg" with dimensions of 8000px height and 960px width. The entire page is designed to fit this size, including the body background. However, I am facing an issue where setting the background for "bg" breaks the body background. Is there a way to display both backgrounds without one interfering with the other?

Example code:

<div class="container">
      <div id="bg"></div>
</div>

CSS

body{
    font-family:  Comic sans, Arial, Helvetica, sans-serif;
    font-size: 100%;
    line-height:normal;
    direction: rtl;
    background: lightblue url('../images/notinuse/clouds.png') top center repeat-y;
    z-index:101;
}
#bg {
    background: blue;
    width: 960px;
    height: 8000px;
    position: fixed;
    z-index: 100;
    top: 0;
}

Adding a background to "bg" causes the clouds to break when they reach the zoom level of "bg". While I understand why this happens, I'm not sure how to make it flow seamlessly. Any suggestions would be greatly appreciated.

Edit >

For a clearer example, here is a screenshot with a strong blue background Dropbox Screenshot. As shown in the screenshot, the clouds do not continue into the "bg" section. I am looking for a way to make them visible in the background of "bg".

Answer №1

Instructions:

#background {
  background-color: transparent;
}

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

Troubleshooting: CSS causing images to not show up on

Struggling with a CSS issue, I can't seem to solve it. My images are not showing up on the webpage even though the URLs are correct and the HTML is properly written. There is no specific styling applied to the images, and the only styling for the ima ...

What is the best way to utilize jquery's $.ajax function in conjunction with json and php to upload a file?

Can someone assist me with uploading a file using jQuery's $.ajax function? I am not getting any output and I'm unsure if my script is correct. Here is the code: $.ajax({ url:'newsup.php', data: "", type: 'POST', cont ...

Is there a way to ensure that text is always displayed at the bottom of an image, perfectly aligned with the left edge of the image, regardless of the parent alignment?

I'm working on creating a layout in HTML/CSS/Bootstrap with an image and text below it. The challenge is to ensure that the text always starts at the left border of the image, regardless of its length. Here's what I need the layout to look like: ...

What steps can I take to successfully implement Tailwind CSS's max-w class?

After successfully using the proper class for setting max width in tailwind, it suddenly stopped working. I'm baffled by the fact that the max-w has refused to take effect. <section class="max-w-[80em]"></section> Previously, I ...

Hidden bootstrap 4 custom checkbox issue

I tried to implement Bootstrap 4 custom control for a checkbox by following the documentation, but the checkbox isn't appearing. Can anyone spot what I might be doing incorrectly? <link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css ...

transferring data from ajax to php script

function showProductDetails(pid) { $.post("product.php", { data: pid}); <?php $productData = $_POST['data']; displayProductDetails($productData); ?> } ...

Hide the 'white' color on visited links and category tags in the WordPress blog page

I created a custom WordPress theme, and I am having trouble styling the bootstrap navigation. I want the text to be white and change to brown when selected. However, my attempts to add a separate class for H1 tags on the blog post page have not been succes ...

Bootstrap 4 row mysteriously shatters apart

I have searched for solutions to this issue but none of them on this forum have been helpful. Hopefully, someone here can offer some assistance. I am facing a problem with displaying 4 columns of data in one row: Here is the code snippet causing the layou ...

Concealing specific outcome by implementing jQuery and AJAX with a database

I have an HTML list that appears as follows: <ul> <li>something</li> <li>something1</li> <li>something2</li> <ul> <div class="randomwrapper"> <img src="<?php echo $databaseresult[$i];?& ...

What is the best way to stop the content in :after from wrapping onto the following line?

How can I add a divider "/" after each li element in my Bootstrap-based menu without it wrapping to the next line? The code I am using can be found here: http://jsfiddle.net/zBxAB/1/ I have tried using inline-block to prevent the slash from wrapping, but ...

Problems Arising with Bootstrap Media Queries on Smaller Tablets in Landscape View

I am currently using Bootstrap's standard media queries for my project and they are working perfectly, except for small tablets in landscape mode. I have included an image to demonstrate this issue. The problem seems to arise from the custom CSS that ...

The bootstrap link transforms into a standard button

My hyperlink stops working when I include Bootstrap code, transforming into a standard button. Here's the code in question: <!DOCTYPE html> <html lang="" dir="ltr"> <head> <link rel="stylesheet" ...

Problem with Pathjs routing

Can anyone help with this routing issue I'm having? Path.map("/(:page_1)(/:page_2)/").to(funct); The route is not matching for: /projects/index2/ It matches /anything, but not /anything/anything If you have any ideas, please share! ...

Validating the userid with jQuery before form submission

Currently, I am working on a form where I need to validate if the userID is already in use before allowing the user to submit it. After some research, I came across a solution on another website. However, when I tried to implement the code, I encountered ...

Is there a way to design a CSS layout that automatically adjusts text wrapping based on the size of the page and columns?

I am attempting to design a CSS page that mimics the appearance of an aged newspaper. The focus is on ensuring that the page is responsive, with a single column of text on smaller devices. However, the main issue I need help with lies elsewhere. For larg ...

Preventing selection of past dates with Material UI in ReactJS

I'm currently working on a date range picker using react material ui. The goal is to allow users to select a specific date and then disable all past dates from that selected date onward. How can I go about implementing this functionality in react mate ...

Utilizing AngularJS to Retrieve Row Information Upon Button Selection

I'm currently developing an application that includes a feature allowing users to run a query from a drop-down menu and view the data in a table. Each row in the table will have a button, and when clicked, I need to capture the values of that specific ...

Tips for making a table header span multiple columns in HTML5

Could someone help me with making my HTML5 heading span across the columns in the table? I want the table to end on the far right with the vertical line appearing at the right end of the table. Any assistance would be greatly appreciated! For reference, ...

Struggling to customize the carousel bootstrap CSS within a CodeIgniter framework

My carousel displays images with varying heights, causing the need to adjust the image height without distorting it. Below is my code snippet: <html lang="en"> <head> <meta charset="UTF-8> <meta name="viewport" content="width=device- ...

The v-menu closes before the v-list-item onclick event is detected

I have set up the following menu using vue and vuetify: <div id="app"> <v-app id="inspire"> <div class="text-center"> <v-menu> <template v-slot:activator="{ on }"> ...