Creating a dynamic design with a responsive background image and three columns of engaging content placed on top using Bootstrap

I'm struggling to translate a design mockup into Bootstrap 3.3.6

Here is an image showcasing the concept I am aiming for:

https://i.sstatic.net/1jZmh.png

The blue background represents an image, with grey text boxes overlaid on top (one of which includes a form). The entire layout needs to be responsive.

To start, I referenced solutions like How to put a background image on a Bootstrap form? and Responsive Form on top of Responsive Image? - Bootstrap

I began by setting the image (depicted as blue in the mockup) within a .container-fluid as a background image:

<div class="container-fluid" style="background-image: url('http://via.placeholder.com/1773x555');">

Even though the above image is 555px high, it doesn't display fully due to lack of content inside the .container-fluid.

Next, I created divs for the 3 grey boxes. This involved crafting 2 .row classes and inserting .col-md-6 for the boxes placement. Code provided below:

<div class="container-fluid" style="background-image: url('http://via.placeholder.com/1773x555');">

  <div class="row">

        <div class="col-md-6">

        </div>

        <div class="col-md-6 content">
            <h1>
               Content here
            </h1>
        </div>

  </div>

   <div class="row">

        <div class="col-md-6 content">
         <h1>
            Content here
            </h1>
        </div>

        <div class="col-md-6 content">
            <h1>
             Content here
            </h1>
        </div>

  </div>

</div>

A .content class was added to style the grey boxes. They should all have uniform size, although adjustments can be made to the dimensions as needed:

.content {
    background-color: #2C3582;
    min-height: 200px;
    width: 400px;
    padding: 10px;
}

I've prepared a fiddle for this setup here https://jsfiddle.net/fku5wffn/1/, but it's not functioning as intended. Some queries persist:

  1. How can I ensure the full height of the background image is visible (even if there isn't enough content within .container-fluid) and make it responsive?

  2. What steps do I take to address the alignment issue with the grey boxes? I require some spacing between them and for their positions to mirror those on the mockup. The discrepancy in position of the bottom two boxes on the fiddle confounds me.

Is achieving this layout feasible, or should I communicate to the designer that it may not be realizable—especially in a manner that retains responsiveness?

Answer â„–1

I utilized flexbox in an attempt to recreate the containers as shown in your image

.container-fluid {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.other-row {
    display: flex;
    justify-content: space-between;
    width:100%;
}

div .other-row:after,
div .other-row:before {
    display: none;
}

Here is a fiddle link for reference: https://jsfiddle.net/dz7cbgdp/2/

To ensure the background-image shows up when there is no content, assigning a height to the div element is recommended.

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 can I retrieve text within a p tag using xpath and xpath axes?

<div class="details"> <p><b>Compatibility:</b> All versions</p> <p><b>Category:</b> Entertainment</p> <p><b>Updated:</b> Apr 2, 2014</p> <p><b>Version ...

Retain the contents of the shopping cart even when the page is refreshed

For a course project, I am recreating a grocery store website and need assistance on how to retain the shopping cart values even after refreshing the webpage. Please inform me if more information is required... <button type="button" id= ...

Struggling to accurately capture the values from checkboxes and dropdown selections to ensure the correct data is displayed. Assistance is needed in this

I am facing challenges in retrieving the accurate data for display from Mat-Select and Mat-Checkbox components. My goal is to capture the selected values from users and perform if-else statements to validate conditions, displaying the correct data view if ...

Error: Unable to execute candidate.toLowerCase as a function

Encountering the following errors: `Uncaught TypeError: candidate.toLowerCase is not a function. I am utilizing the AutoComplete API within Material UI, however, when I search in the input field, it leads me to a blank page. This is my current code snippe ...

Guide to designing a CSS gradient with a downward arrow linked to a specific container

I'm attempting to add a triangular arrow beneath the v-container, complete with a gradient color scheme. However, I'm struggling to integrate the gradient seamlessly. If I use CSS to create the arrow, the gradient doesn't align correctly. ...

Bootstrap's popover showing only the title and ceasing to function after the initial toggle

I'm facing a challenging problem as I follow the example in the documentation but the desired outcome just won't materialize. Here's what I've done: Imported Bootstrap Imported Popover Initialized Tooltips Initialized Popover All step ...

Vue.js is not incrementing the counter as expected

I've encountered an issue with a button that has a click event to increment data value by 5, but instead of adding 5 it is appended by 5. Click here for the code example <div id="react"> <button @click='counter += 5'>Increment& ...

Expanding the axes using Google Charts

Seeking to Expand Y-Axis I am attempting to stretch the Y-axis so that it counts up to 300 instead of just 100. The issue arises when I adjust the Y-axis to reach 300, as the values remain in the same position as they did when counting to 100. Fo ...

How can I set a dropdown back to the first index in MVC?

Within my MVC project, I have a dropdown list bound in a div using the code snippet below: @{ List<SelectListItem> lsqty = new List<SelectListItem>(); for (int i = 1; i <= 10; i++) { SelectListItem sl = new SelectListIt ...

Transitioning the CSS background for a lightbox display

I am currently experimenting with creating an image that fades in along with its background when clicked using the :target selector. (Similar to Lightbox: , but done purely with CSS). Here is the HTML: <a href="#firstimg"><img src="img/thumb-3.j ...

Interactive webpages with dynamic HTML content, similar to the design of popular platforms such

Explore the source code of Dropbox's homepage or any Soundcloud page. They utilize various scripts and minimal pure HTML content (article, main, p, div). This method of generating pages is referred to as dynamic content/HTML. The main function seems ...

PHP-AJAX form submission causing Bootstrap alert to not appear

I'm attempting to display an alert when the user submits the form, regardless of whether it is successful or not. The script successfully submits the data but the alert isn't appearing. Here's the code: NOTE: The form is within a Bootstrap ...

What is the best way to display content next to an image, as well as below the image once it finishes?

Currently, I am working on customizing my blog posts in WordPress. My goal is to have the content of each post displayed next to the post thumbnail, and once the image ends, the content should seamlessly flow underneath it from the left side. I have imple ...

Presentation - hyperlink only functioning for final slide

I have a question about Lean Slider, which you can check out at My goal is to link each slide to a different URL. However, I'm facing an issue where only the code in the last slide seems to be executed and applied to all other slides. For example, if ...

Using Javascript to generate a button that randomly chooses links within the webpage

Looking for help with JavaScript to select a link when a button is clicked on the page? Check out my code and let me know what I'm doing wrong. For the full code, visit: here HTML <!doctype html> <html lang="it" xmlns="http:/ ...

JavaScript and CSS failing to implement lazy loading with fade-in effect

Is there a way to add the fade-in animation to an image when it is loaded with JavaScript or CSS? Currently, the code I have only fades in the image once it is 25% visible in the viewport. How can I modify it to include the fade effect upon image load? ...

Tips for saving an HTML image with a unique source format (blob)

As I examine the element, the src displayed for the img is an incredibly long string that had to be significantly shortened for it to fit here. data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAyAAAAMgCAYAAADbcAZoAAAAAXNSR... However, when I extract the src ...

open a fresh modal by closing the existing modal using just one button

I am trying to implement a unique functionality in my bootstrap based project. I have one modal that I want to link to another modal, however, I am facing some challenges in achieving this. Currently, I am attempting to use the modal.close() and .modal(&ap ...

The height set to 100% is causing issues with the padding-bottom property

Currently, I have a setup that includes: A div with width set to 100% and height set to 100% An SVG element inside the div with default width and height of 100% My issue is that when applying padding to the div, the left, right, and top padding seem to w ...

Pop-up notification badge using AJAX technology

Is there a way to implement a notification number badge using Ajax, similar to what Facebook does? I can't provide an image here, but most people are probably familiar with the concept. It's like when you sign into Facebook and see a small number ...