Creating content directly beneath an absolute background image

I designed a webpage with background images in a div featuring a slideshow and content display. Now, I'm facing an issue where any new sections I add after the background image end up positioned behind it, appearing at the top of the window as if there was no previous content on the page except for a sticky navbar. Below are the relevant code snippets.

I want to incorporate different parts into my webpage below the background image. Any suggestions on how to achieve this?

Note: My primary focus is on running this website in full-screen windows; please ignore any visual issues that arise in non-full-screen modes.

*,
*::before,
*::after{
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}
body{
    background-color: aqua;
} 
... (CSS code omitted for brevity)
 
<!doctype html>
<html>
<head>
   ... (Head section content omitted for brevity)
</head>

<body>
<header>
   ... (Header section content omitted for brevity)
</header>
    <div class="container_slider">
        ... (Background image content omitted for brevity)
     </div>
<div class="box"></div>
</body>
</html>

Answer №1

Your wrapper and inner elements were both set to position absolute. I have adjusted the .container_slider to relative positioning in order to properly wrap your slider and box.

[screenshot of the new layout][1]

Check out the screenshot here: https://i.sstatic.net/8hTNT.jpg

*,
*::before,
*::after {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}
body {
    background-color: aqua;
}
header {
    z-index: 999999999;
    overflow: hidden;
    position: sticky;
    top: -31px;
}
<!-- More CSS code follows -->

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

Repeated Outcomes in SQL Query

Looking for help with PHP coding! I've been stuck on this problem for a few days and need some assistance. I have two tables in my database: "projects_2016" and "attachment". My goal is to display data from "projects_2016" in the top table and then ...

In CSS3, utilize the calc() function to vertically center elements using viewport height (vh) and viewport

One of the most common cases involves using vh for setting the height of a div, and using vm for adjusting font size. Using CSS3 div.outer { height: 20vh; } div.inner { font-size: 3vw; height: auto; } div.inner2 { font-size: 2vw; } HTML - Scenario 1 <d ...

The full-page layout features a convenient scroll bar situated at the bottom for easy

I've been grappling with a perplexing CSS issue that is causing a scroll bar to appear on a full page. Initially, my div layout was as follows (with no scrollbar problem): Container 100% (width) wrapper 80% navMenu 100% centerDoc 100% Ho ...

If the ng-model value is 0, the HTML placeholder will take precedence and override it

Is there a way to customize ng-model so that it shows the placeholder value instead of the actual ng-model value when the value is 0? The UX requires one value for ng-model, while the business logic requires another. How can this be achieved? For example ...

Merge floating and absolute positioning techniques

Creating a calendar exhibiting all events in one div requires precise positioning based on the values of top and height. Let me demonstrate this concept. In the image below, both 6am events are aligned vertically. This alignment issue can be resolved by u ...

The play() function is malfunctioning in Internet Explorer 11

I am having an issue with using the onclick function to call and play a file. The file plays fine in Chrome and Firefox, but not in ie11. Below is the code snippet: function play1(){ var audio1 = document.getElementById("audio1"); audio ...

Exploring the world of HTML5 speed testing: getting started

Can anyone provide guidance on how to begin with an HTML5 bandwidth test? I am trying to replicate a flash-based version and any recommendations would be greatly appreciated. ...

In my HTML document, I have three identical Id's and I need to figure out how to target the third one using CSS. Can you help

I am working on an HTML document that contains multiple instances of ids and classes. Here is a snippet of the code: <!DOCTYPE html> <html> <body> <div id="Caption_G" class="editor-group"> editor-group<br /> ...

Is there a way to display the division symbol using PHP?

I have come across this question multiple times, but am yet to find a satisfactory resolution. Is there a way to output the division sign (÷) using PHP? Every time I attempt to echo it, the output is just showing a strange symbol . ...

Prevent automatic jumping to input fields

Can someone help me with a problem related to the html input tag or primefaces p:input? I am facing an issue where the cursor always automatically jumps into the input field. The height of my page is such that scrolling is required, and the input field i ...

Exploring the power of CSS grid in React/Gatsby for creating dynamic layouts with varying numbers of columns in each

I need help creating a dynamic grid layout where the number of columns alternates between rows. For example, I want the first row to have one column, the second row to have two columns, and so on. Right now, my grid only has two columns per row. Does anyon ...

Is transforming lengthy code into a function the way to go?

I have successfully implemented this code on my page without any errors, but I am wondering if there is a more concise way to achieve the same result. Currently, there is a lot of repeated code with only minor changes in class names. Is it possible to sh ...

Tips for minimizing the spacing between a label, span, or paragraph that causes the text to wrap

I recently created a label with text inside it. However, when I shrink the screen size, the label splits into two lines but the spacing between them is too wide. How can I narrow down this space? Below is the code snippet: <div class="col-xs-12 textA ...

Utilizing PHP to create an interactive website

As a novice PHP developer, I took to Google in search of tutorials on creating dynamic PHP websites. What I found was that many tutorials used the $_GET variable to manipulate URLs and make them appear like this: example.com/?page=home example.com/?page= ...

Issue with Tooltipster plugin causing jQuery function not to trigger upon clicking the link within the tooltip

Recently, I've been experimenting with a jquery plugin called Tooltipster by inserting some HTML into the tip with an href link. The problem arises when I try to add a class to the href and fire a jquery function upon clicking it. No matter how much I ...

Expanding the footer dynamically using jQuery and CSS

Currently, I am working on a webpage where the footer expands based on a specific event. My challenge is to ensure that the footer grows in proportion to the available space on the page. You can take a look at my code snippet or the corresponding jsFiddle ...

JavaScript code that activates several hovering elements

I am a beginner in the world of JavaScript and I'm attempting to create a simple function that will activate multiple div hover effects. I have tried various approaches so far, but I believe this code is closer to the solution. Any assistance from som ...

What is the reason behind v-container in vuetify.js automatically setting the fluid property when zoomed to 67%?

I have encountered an issue with vuetify where the v-container automatically takes full width at 67% zoom of the browser, even though I have not used the fluid property. It seems to work fine for the rest of the cases. <v-container> < ...

"Enhancing button design with an adjacent image - the step-by

I am having an issue with my hover dropdown menu where the image is not displaying properly in the main button. When I hover over the user12345 button, the image appears on the left side just before the hover shadow. Below is the code snippet for the dropd ...

Synchronize the widths of two tables using jQuery

Hi everyone, I need help with aligning two tables in jQuery. Is there a way to dynamically make the width of table 2 the same as table 1? If I could somehow set the width of the td elements in table 2 to match the width of table 1, they would line up per ...