Issues with negative margin causing background image to not display correctly

Hey there, I'm currently trying to add a background image to the bottom left of my webpage. The layout includes both left and right sidebars. Unfortunately, I've encountered some issues with positioning the image using CSS in both the left sidebar and main content area.

Here's the look I'm going for: (It's the girl at the bottom left of the page that I want to remain fixed there regardless of the page length.)

However, the image currently appears like this with the CSS I've implemented:

This is the CSS I've used:

.Content {
background: url(../../__custom/images/blue/page-bottom-1.jpg) left bottom;
background-repeat: no-repeat; 
overflow: visible;
}

.Left {
background: url(../../__custom/images/blue/page-bottom-1.jpg) left bottom;
background-repeat: no-repeat; 
overflow: visible;
}

When I adjust the background position like this: background:

url(../../__custom/images/blue/page-bottom-1.jpg) -150px 100%;

Answer №1

Would you mind sharing your HTML code with us? I have a feeling that the .Left class may not be extending all the way to the bottom of the column, but it's difficult to confirm without viewing the markup.

Answer №2

If you're looking for a solution, it might be helpful to share your HTML code. One suggestion is to assign the background image to the main container div, which is likely the parent of the left div.

For example, if your code looks like this:

<div class="main-container">
   <div class="left"></div>
   <div class="content"></div>
   <div class="right">   

Then your CSS style would be:

.main-container {
 background: url(../../__custom/images/blue/page-bottom-1.jpg) no-repeat scroll left bottom;
}

Hopefully this solution works for you!

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 adjust two overlapping divs for proper display?

It seems like I have two divs overlapping on the same line. The layout appears fine on a PC but not on an iPad or mobile device. Can someone please review the code and point out any mistakes I might have made? The issue is with the content overlapping the ...

What is the process for dividing a form into two separate columns?

I am working on a form that sends input to a PHP script. I want to reorganize the form so that the second section (Person 2) appears in a column to the right of the first section (Person 1), instead of below it. <link rel="stylesheet" href="test.css" ...

Steps to deactivate a JavaScript function once the page has undergone a Page.IsPostBack event

My current setup involves a simple div with the display set to none. Upon page load, I use $("#MyDiv").show(); to display the div after a delay, allowing users to enter information into the form and submit it using an asp.net button. After submitting the ...

Understanding how to automatically adjust margins in Bootstrap based on screen width

When viewing in fullscreen, the margins are set to ensure the container fits entirely within the page. However, without the 200px margin in the .gallery class, the container would be too big to fit on the page without scrolling. The problem arises when th ...

Is there a way to ensure that spans are inline with a div?

My structure is pretty straightforward: <div></div><span></span><span></span> However, I'm looking to have them all appear on a single line. Currently, they are rendering like this: <div /> <span />&l ...

Like button for Facebook located at the bottom of a static webpage

I am facing an issue with my web application where it does not scroll properly, especially when there is a Facebook button at the bottom. The behavior in Chrome and Firefox is inconsistent and causing some trouble. In Chrome, the div repositions correctly ...

Steps for embedding a webpage within a div element

I am facing an issue while trying to load a web page within a div using an ajax call. Unfortunately, it's not working as expected and displaying the following error message: jquery.min.js:2 [Deprecation] Synchronous XMLHttpRequest on the main thread ...

There appears to be a gap on the right side of the <span> element, resembling an additional space at the end

While testing a button on my website, I noticed that all the spans have an extra space at the end. Adding a background box made this gap very noticeable. Upon further inspection of my other pages, I realized that the issue exists there too. I have not made ...

Attempting to align two div blocks side by side to occupy the entire page

http://jsfiddle.net/UeLMA/1/ Here's the HTML code snippet: <div id="left" style="background: red; display: inline-block; float: left"> aaaa<br /> aaaaa </div> <div id="right" style="background: yellow; float: left">&l ...

Utilizing the <style scoped> feature within my Angular template

When adding CSS styles in the specified htm file's templateUrl while loading a directive, I wonder if this is a bad idea. Will it be repeated every time the template is instantiated on the rendered page, or does Angular handle this differently? By usi ...

Struggling to center a modal at the exact middle of the page using Bootstrap 5

My navigation bar has a button that, when clicked, triggers a modal to appear at the top of the page. I am trying to center it horizontally. Here is the HTML code: </button> <!-- </button> --> <div class="text-dark "> < ...

The sticky position is malfunctioning even when there is no parent element with the overflow hidden property

// observer for feature section let featuresSection = document.querySelector('#featuresSection'); let callbackFeature = (items) => { items.forEach((item) => { if (item.isIntersecting) { item.target.classList.add("in ...

Element does not cross both explicit and implicit columns

When working in a grid container with only 1 column and 1 row, if there is an implicit column in the first row, how can an element in the second row (as shown by the green column in the example) span across both the explicit and implicit columns? I appreci ...

Customize the default styles for Angular 2/4 Material's "md-menu" component

Seeking to customize default styles of md-menu in Angular Material. The challenge lies in the dynamic generation of elements by Angular Material, preventing direct access from HTML. Visual representation of DOM: https://i.sstatic.net/v8GE0.png Component ...

Conceal the information beneath a see-through fixed navigation bar when scrolling downward

the issue: I am facing a challenge with my transparent fixed navbar that has a margin-top gap. The content below the navbar needs to be positioned under it while scrolling down, but the background of the page is a dynamic slideshow of various images. This ...

Make the background image come to life by animating it from the bottom to the top in

Upon landing on a page, I aim for the background image to initially focus on the bottom and then pan up to the top before returning back down in a continuous loop. The code I have set up is as follows: <body> <div id="container"></div&g ...

Modifying the dimensions of mat-card in Angular Material

https://i.stack.imgur.com/CP16N.png I am struggling to make both components the same height, similar to the left form. I have tried adjusting margins and padding but nothing seems to work. Below is the HTML code for the parent element: <mat-tab label= ...

What is the process for setting dynamic variables as CSS content within Vue.js?

Forgive my lack of expertise, but I am interested in learning more about utilizing dynamic variables and CSS within Vue. I have a concept in mind where pressing a button would result in the letters of the button label spacing out further. Is it feasible t ...

Changing colors in the rows of a table

Here is a fiddle I created to demonstrate my issue. https://jsfiddle.net/7w3c384f/8/ In the fiddle, you can see that my numbered list has alternating colors achieved through the following jQuery code: $(document).ready(function(){ $("tr:even").css("ba ...

Webpage created from scratch encounters technical difficulties on mobile device browser

My website seems to be getting stuck at the beginning of a section, particularly on mobile browsers. You can check out the website here <section class="home-slider owl-carousel"> <div class="slider-item" style="background-image: url(images/bg ...