Is there a way to make the background-attachment:fixed property responsive?

I'm looking to achieve this: https://youtu.be/shgvBWJ-lTw?t=175

However, when I try to implement it, the result is not responsive. How can I make it responsive using HTML, CSS, and Bootstrap?

I have attempted several solutions, but none have worked so far.

Answer №1

Unfortunately, without images from your code or website, it's difficult to determine why your image is not responsive. One solution could be to create a section with .container-fluid so that it has 100% width and is responsive. Then, adjust the CSS for the box containing the image like this:

example:

.box is the element where you want to use your fixed background image.
.box{
    background-image: url('image.jpg');
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
    width: 100%;
}
  • This suggestion may or may not solve your issue, but it's worth trying. If not, consider exploring other solutions or providing images next time along with your code or website. :D

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

Adjust the appearance of a button with Jquery Ajax to reflect a color fetched from an external PHP script

This piece of code represents my HTML: <form class="addtowatchlistform" action="logo/insertwatchlist.php" method="POST"> <input type="hidden" name="tmdb_id" value="'.$result[$x]["tmdb_id"].'"/> <button id="addtowatchlistb ...

Customizing HTML 5 Validation Techniques

I am in need of a form that has some specific requirements: It should show validation messages in a custom format instead of the default style. All invalid field bubbles should be displayed at once, rather than one at a time. Currently, I am dealing with ...

Firefox experiencing issues with width scaling

I'm having an issue where the main image is not resizing when I adjust the window size, specifically in Firefox. Here is the URL in question: How can I solve this problem? I attempted using width: 100% in .banner_right, but it only made things worse ...

Creating dynamic DIV elements in an AngularJS file using data retrieved from a Sql server

I need to dynamically add elements based on data retrieved from a MSSQL server in the specified area: <div id="ApplicationForm" class="tabcontent" style="display:none;"> <div class="tab_section"> ...

What is the best way to extract the frameset from a frame window?

Here is a code snippet to consider: function conceal(frameElem) { var frameSet = frameElem.frameSet; //<-- this doesn't seem to be working $(frameSet).attr('cols', '0,*'); } //conceal the parent frame conceal(window.pa ...

Dealing with empty POST request bodies in Node.js Express is a common challenge

In my Node.JS project using Express framework, I am encountering an issue while trying to access the body of a POST request. The POST request is being sent through an HTML form, and upon checking with WireShark, I can see that the request is indeed getting ...

Using a regular expression to swap out the final image tag or character

Recently, I encountered an HTML string that resembles the following: <html> <head> <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"> </head> <body style="font-f ...

Automated HTML loader

I have a webpage that utilizes AJAX to load portions of HTML content. These fragments contain images, some of which are specified in a separate CSS file using background-image properties. I am trying to implement a pre-loader so that the loaded content w ...

Can an unordered list be nested inside an inline list item in HTML or XHTML?

Take note that the li with child ul is set to display:inline - example code provided below <style type="text/css"> ul.nav_main li { display: inline } ul.nav_submenu li { display: block } </style> <ul class="nav_main"> <li>I ...

Elevation in design ui component

I am having an issue with the height of a theme-ui component I embedded. Even though the console shows it correctly, it is displaying at 100% height. <Embed src={url} sx={{width: '800px', height: '400px'}}/> This embed is contain ...

What is the simplest and least time-consuming method for populating HTML fields with a basic JSON dataset?

I am currently working on a simple software project and I would like to create a set of fields in a jQuery modal dialog. Given certain restrictions, I believe it would be more convenient to utilize jQuery's AJAX functions for communication with the se ...

Angular directive button failing to trigger ng-click event

Recently, I started working with Angular and ran into an issue while trying to set up a custom directive. The purpose of this directive is to display a button upon hovering over it, which, when clicked, should trigger a function within the directive. The b ...

Apply CSS using JQuery at the start of an event and then revert it back at the end

Is there a way to notify users that the site is loading while a function with noticeable execution time is running? I have an associated change function which is connected to a drop down filter used for sorting through data on the page. $("#job_group").ch ...

Having trouble centering SVGs on the screen

My goal is to shift elements of the SVG to the center of the screen upon clicking, but I haven't been successful so far. It's puzzling because it worked flawlessly with a different SVG. I've tried following the advice given in this post, an ...

Seeking assistance in creating custom tabs for integration with a jQuery tabs plugin

Attempting to navigate the world of CSS as a newbie, I find myself struggling with creating tabs. Our current tab setup can be viewed here, but unfortunately, these tabs are created using an unattractive <table> tag. Below is the code responsible fo ...

Submission handling with JQuery forms is not functioning

Currently troubleshooting my jQuery contact form submission handler. For some reason, the code isn't working as expected and I'm not sure where the issue lies. Upon form submission, there should be a success or error alert displayed, but nothing ...

Customizing CSS for Each Web Page in Rails Application

Exploring the possibility of testing out two different interfaces for my Rails application has led me to consider using two separate CSS files - one for each interface. For instance, I envision having a new_interface.css and an old_interface.css file for t ...

Update the background color when a selectable option is chosen and not disabled

I am searching for a solution to modify the color of a select box if one of the disabled options is not chosen. Here is an example of the dropdown: <select class="selectoption" name="desc[]"> <option disabled="disabled" selected="sel ...

Creating a modern and sleek design with Bootstrap 4 is easy with its ability to implement 2

Currently rocking Bootstrap 4! I've got a row with 2 columns - how do I go about centering the second column (col-8)? <div class="row main-nav"> <div class="col-1"> <a (click)="returnPreviousPage()" class="main-nav-button"& ...

How can you display a border around a <td> element in an HTML table only when it contains data, using jQuery or JavaScript?

My HTML table consists of the following structure: <table class="table table-bordered"> <thead> <tr> <th>Tag</th> <th>Time Code</th> </tr> </thea ...