Background Image Troubling CSS Issue

I am having an issue with adding a background image to my site header. The main content should cover part of the image, but even after setting the z-index, it's not working as expected.

You can view the website here

Any ideas why this might be happening?

Thank you!

Edit:

If you look on the right side of the page, you'll notice that the brown egg is not completely covered by the main content.

Here is the code for the header navigation:

.header-navigation.back {
    z-index: -1;
    position: absolute;
    margin-left: 0;
    margin-top: -6px;
    border: none;
    display: block; 
    height: 137px; 
    width: 1171px; 
    padding: 0px; 
    outline: none; 
    text-indent: -9999px;
    background-image: url('http://frenchegg.com/images/backmenu.png');
}

And here is the styling for the main content:

.main-content {
    z-index: 99;
    position: relative;
    padding: 1em 0 8.5em 0;
    background: #fff;
}

Answer №1

Kindly include the overflow:hidden css property in the header-wrap class

.header-wrap {
  ...
  overflow: hidden
  ...
}

This adjustment will enhance the appearance.


To address the login issue:

Eliminate the z-index: 99999 from the .bann class

and introduce this new css to the tooltip-wrap class

sorry something went wrong

Thank you

Answer №2

It appears that a simple solution would be to decrease the height of the header-navigation.back rule to 100px instead of adjusting the z-index.

Answer №3

I recently updated the bann class to:

.bann {
    cursor: pointer;
    display: block;
    height: auto;
    position: relative;
    width: 101.5%;
    z-index: 99999;
    margin-left: 12px;
}

After making this change, everything appears to be functioning correctly. Please verify and provide feedback on the outcome;

I conducted a test using Firebug for the code mentioned above ;)

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

The CSS Accordion seems to be the culprit behind the missing margin or border at the top of my page

Although everything on the page is functioning as desired, there seems to be a missing margin or border that is not causing much trouble. If there is a simple solution or an easy way to identify why this is happening, it would be greatly appreciated. Take ...

CSS styles from Angular 2 components spilling outside of their boundaries

Check out the Plunker where I'm facing an issue. "If you comment out the styles in the ThirdComponent, you can see it affecting the parent and sibling components' styles." – adriancarriger (Special thanks to Adrian) Within my component, I am i ...

"Aligning two images side by side in a horizontal

[enter image description here][1]I am trying to place two images on my website, but I am struggling to vertically align them properly. I have attempted using line-height and vertical alignment, however, I cannot seem to pinpoint the issue or identify any m ...

Is there a method in CSS animations that allows for endlessly repeating successive animations in a specified sequence?

While working with CSS animations, I encountered a challenge of making two animations occur successively and repeat infinitely without merging keyframes. Is there a way to achieve this using only CSS? If not, how can I accomplish it using JavaScript? I a ...

Alignment troubles persist with text formatting

The alignment of the link at the bottom of the page seems to be causing an issue. <!DOCTYPE html> <html> <head> <link rel="stylesheet" type="text/css" href="cssforwebsite.css"/> <link href="https://fonts.googleapis.com/c ...

bootstrap 4 appears to encounter some responsiveness issues when it comes to rendering on iPhone

https://i.sstatic.net/rdOtX.png While inspecting my website on mobile using developer tools, everything looks perfect. However, when I view it on my actual iPhone 6, the layout seems off. Could this be a bug specific to the iPhone 6? Here are my meta tag ...

What is the best method for eliminating a character from all elements in jQuery classes?

I am working on an Angular 4 app where every .inner-page class in a html element includes a "/". For instance: <div _ngcontent-c0="" class="inner-page /login"> <div _ngcontent-c0="" class="inner-page /register"> I need to eliminate the "/" c ...

Adjusting the arrangement of div elements based on screen dimensions or orientation within an Ionic grid system

My HTML setup looks like this: <div class="row"> <div class="col-sm-12 col-md-6 col-xl-3"> </div> <div class="col-sm-12 col-md-6 col-xl-3"> </div> <div class="col-sm-12 col-md-6 col-xl-3"> </d ...

Center two elements within a div container both horizontally and vertically

I am trying to vertically center a text and a button within a container. The text should be positioned in the middle of the div, while the button should be aligned to the right. What is the best way to achieve this layout where the text element is centere ...

Customize the Header Background Color in React Table

I'm working on customizing a re-useable table component using vanilla CSS. I have defined six color variables and want users to be able to select one of them to change the table header background color. However, I am unsure how to make this color choi ...

Tips on Creating a Responsive Absolutely Positioned Div for Various Screen Sizes

I'm currently working on a website and I've come across an issue regarding the responsiveness of an absolutely positioned div across various screen sizes. Let me provide some context and share what I have attempted so far: Issue: Within the head ...

CSS styles are not getting rendered by Firefox when loading content using jQuery AJAX

My website allows users to comment on books and articles, with a search input to find relevant sources. Using jQuery, I dynamically load new sources from an outside site based on search terms and display them in a list using AJAX. However, I’m facing two ...

Customize your webpage's style to reflect your unique identity with user

Is there a way to allow users to customize the style of a webpage? I know I need multiple CSS files, but how can I implement the code that enables this customization based on user preferences? ...

Exploring the process of customizing native classes with Vue.js

Within vue-awesome-swiper, there's a standard class called this: .swiper-button-next { position: absolute; right: 46% } The task at hand is to adjust this CSS code only for right-to-left layouts, like so: .swiper-button-next { position: abso ...

How to position two divs to the right of another div, without them being adjacent to each other, using CSS

I am trying to arrange three divs with background colors of Red, Yellow, and Blue. The goal is to have the Red div on the left, followed by the Yellow div next to it, and then the Blue div underneath the Yellow one. However, my current code is not producin ...

Set Divs in Absolute Position Relative to Each Other

I need to create a simple navigation system using <div> elements as individual pages. The goal is to have "next" and "back" buttons that allow users to switch between these pages with a smooth fade-in and fade-out effect, all powered by jQuery. Howev ...

Can the :after pseudo-element be modified when hovering, except when hovering over the after element itself?

Currently, my CSS code looks like this: class-name:hover:after {} Although it works well, the hover effect triggers even when hovering over the after portion of the element. Is there a way to modify the code so that the :hover only applies when hovering ...

I noticed that when I am scrolling through my website, the navigation bar becomes hidden due

I'm facing an issue where my navbar disappears when I try to scroll to the second page of the website. Can anyone explain why this is happening, or provide a tutorial or course that I can reference? index.html This is the index.html file where ...

Bootstrap grid: Preventing horizontal scrolling when all columns cannot fit in a single row

Why is it that when the column does not fit in one row, instead of showing a horizontal scrollbar, it goes to the bottom? <div class="container-fluid main-container" style="overflow-x: auto; width:600px"> <div class="row mx-5"> < ...

Tips on how to include a unique style sheet for IE8 in WordPress

Struggling with responsive behavior in IE8, some parts of my Wordpress website at are not displaying correctly due to issues with the @import query. To tackle this problem, I am considering creating a separate style sheet for IE6, 7, and 8 using the follo ...