Utilizing Bootstrap 3.0 to create a dynamic design featuring multiple overlapping full-width background images

I'm currently in the process of constructing a static webpage utilizing Bootstrap 3.0.

This particular page follows a storytelling format, consisting of multiple sections stacked on top of each other with background images. Text and additional images/elements are then overlaid on these backgrounds.

My intention is for users to scroll from top to bottom, with each section's background image spanning the full width of the screen.

In the future, I plan to incorporate parallax effects using Skrollr (https://github.com/Prinzhorn/skrollr).

However, at this moment, I am encountering difficulties implementing functional HTML/CSS with Bootstrap.

Initially, my approach was something like this:

<body>
<div class="container">
    <section id="first">
        <div class="row annoucement col-md-4 col-md-offset-4">
            <h1>The story of...</h1>
        </div>
    </section
    <section id="second">
        <div class="row gallery col-md-4 col-md-offset-4">
            <!-- Image gallery boxes -->
        </div>
    </section
</div>

Followed by the corresponding CSS:

    #first {
        background: url(img/1.jpg) no-repeat center center fixed;
        -webkit-background-size: cover;
        -moz-background-size: cover;
        -o-background-size: cover;
        background-size: cover;
    }

Unfortunately, the background images do not appear as expected - the #first element ends up being 1140px x 0px, resulting in the failure to display the image.

I have a hunch that I might be misusing tag types - any recommendations on how I can achieve the desired layout with Bootstrap?

Answer №1

It seems that there is an issue with your grid system markup. Take a look at the examples provided in the documentation. The .row element should be within a container element. If you want the background to cover the entire page, the sections should not be inside the container. Here's how I would suggest structuring it:

<body>
    <section id="first">
        <div class="container">
            <div class="row announcement">
                <div class="col-md-4 col-md-offset-4">
                     <h1>The story of...</h1>
                </div>
            </div>
        </div>
    </section>
    <section id="second">
        <div class="container">
            <div class="row gallery">
                <div class="col-md-4 col-md-offset-4">
                    <!-- Image gallery boxes -->
                </div>
            </div>
        </div>
    </section>
</body>

You may need to adjust the span size of your content as col-md-4 might be too small for your needs. This decision ultimately depends on your specific requirements :)

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

How to refresh the page when pausing the YouTube iframe API

I'm encountering an issue with my code where I am trying to refresh the page when exiting or pausing full screen mode. Exiting full screen is working as expected, however, pausing using the YouTube iframe API's "onstatechange" event does not seem ...

Guide on displaying an EJS page with AngularJS on a Node.js server

Having an issue with rendering an ejs page through nodejs. The page works fine independently, but fails to load when rendered via nodejs. Any help would be appreciated. ejs page: <html> <script src="/home/aniruddha/Downloads/angular.js"></ ...

Transform the JavaScript object received from an AJAX request into HTML code

Here is an example of what the result (data) looks like: <tr> <td> Something... </td> </tr> <div id="paging">1, 2, 3... </div> This is using ajax to retrieve data. ... dataType: "html", success: function( ...

Using Django templates to include JavaScript files stored in the static directory

I'm facing an issue: within addWorkout.html: {% extends "workout/base.html" %} {% block footer %} <script type="text/javascript" src="{% static js/addWorkout.js %}"></script> {% endblock %} within base.html: {% load static %} <!DOCT ...

Automatically populate fields when the selection changes

Currently, I am facing an issue with a mysql table named clients that I utilize to populate the options of a select in one of the rows. The goal is to automatically fill out 2 input fields with client information when a specific option is selected. To acc ...

Side panel with collapsible Bootstrap functionality

The accordion panel is structured as follows <p> <a class="btn btn-primary" data-toggle="collapse" href="#collapseExample" role="button" aria-expanded="false" aria-controls="collapseExample"> Link with href </a> </p> <di ...

Modify the div height to match the parent div's height

I'm currently working on customizing a navigation panel, and I'm looking to align the styles of the various options with the parent div. One specific adjustment I need to make is setting the background color of the options to match the parent div ...

Assigning a value to a hidden field using a Bootstrap radio button

I'm having some difficulty setting the value of a hiddenfield using a Bootstrap radio button. Below is the code for the button group with the radio buttons and the hiddenfield. <div class="myRow"> <div class="smallCol"> ...

Revamping repetitive JavaScript code for the pagination of Instagram Stories

I'm currently developing a website that utilizes fullpage.js and includes a section with multiple slides. These slides automatically transition every 10 seconds. I wanted to implement progress bars similar to those on Instagram, where each bar fills ...

Ensure that the next iteration of .each() does not begin until all nested functions have finished executing

Is there a way to ensure that my .each() function waits for all nested functions to complete before moving on? Here is the code I am working with: HTML: <div> <p>Text 1</p> <p>Text 2</p> <p>Text 3</p> & ...

Exploring jQuery Efficiency: Comparing CSS and Animation Techniques

I am trying to steer clear of using the animation property because it tends to be slower compared to CSS3 animations. My query is whether utilizing the css method is faster than the animation property, but still slower than a direct CSS3 animation with tr ...

Is it possible to organize a querydict in templates?

Within my template, the following code is included: {% for user in users %} <tr> <td> <div class="info"> <h4>{{ user.name }}</h4> <h5>{{ user.age }}</h5> </div> ...

PHP script for image upload is malfunctioning

<? if(isset($_POST['upload'])) { if(empty($_FILES['image'])) { echo "<p class=\"error\">Please upload an image...</p>\n"; } else { $file_name= $_FILES['image']['name' ...

Globals is not provided in NullInjectorError

Currently, I am in the process of developing a global variables file using Angular 6. The goal is to have these variables accessible and modifiable by various components within the application. To assist with this task, I came across a helpful sample on th ...

Displaying three tables in each row using ng-repeat, with the ability to repeat the process multiple times

Is it possible to repeat a table multiple times with each set of three tables in the same line using AngularJS and Bootstrap? I am unsure how this can be achieved with ng-repeat. table 1 | table 2 | table 3 table 4 | table 5 | ... <div ng-repeat="zo ...

I'm experiencing some unexpected behavior in JavaScript when I try to apply style changes using JavaScript. Is it possible that transitions are not occurring in both cases as expected?

Everything seems to be working fine with the transition, but when I skip using setTimeout and directly apply the transform, the div instantly reaches the end of the transition. function move(x, y, delay) { let el = document.getElementById('myDiv& ...

React forms are experiencing issues with characters overlapping

Having trouble with overlapping label and input letters in my React form. Looking for: The appearance shown in the top image Experiencing: What is displayed in the bottom image Any solutions on how to resolve this issue? https://i.sstatic.net/Y3W2m.png ...

AngularJS compatibility problem detected with IE Edge mode

I am facing an issue with my AngularJS Web application when it is deployed to a higher environment and accessed through IE Edge. The browser defaults to IE 8 mode, which does not support AngularJS, causing my application to not work as expected. To try an ...

Passing a value from an HTML template to a method within an Angular 4 component

Encountering an issue with Angular 4. HTML template markup includes a button: <td><a class="btn btn-danger" (click)="delete()"><i class="fa fa-trash"></i></a></td> Data is assigned to each td from a *ngFor, like {{ da ...

What is preventing me from negating the TR's style?

Is there a way to set the initial style of a TR element to an empty string? I've tried using the cssText property but it doesn't seem to work (needs to be compatible with IE8). <html> <head> <style> tr.test {background-co ...