Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7435231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:02:16+00:00 2026-05-29T10:02:16+00:00

The PNG image is the sidebar, and the black part is the CSS background,

  • 0

The PNG image is the sidebar, and the black part is the CSS background, the PNG’s alpha seems to override the black box.

enter image description here

When I change the image’s opacity, you can see the box continues through the entire image, but is still overridden and I double-checked the sidebar’s transparency, but it’s set up properly.

enter image description here

It does this on Google Chrome as well as Firefox.

Relevant CSS:

.sidebar{
    background: url('side1.png') lightgray 10% 50%;
    background-repeat: no-repeat;
    background-size: 100%;
    height: 600px;
    width: 173px;
    z-index:1;
    float:left;
    position:relative;
    opacity:0.5;
}

.header{
    background: black;
    background-position: top right;
    float:right;
    width:100%;
    height: 200px;
    z-index:0;
    position:absolute;
}

Relevant HTML:

<div class="sidebar">
    <img src="images/pic1.png" class="icon">
</div>

<div class="header"></div>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T10:02:17+00:00Added an answer on May 29, 2026 at 10:02 am

    This appears to be just a simple case of the division going back behind the floated content. Most people don’t realize that just because there is floated content there, the division still expands back behind it all the way to the edge, like it normally would if the floated content wasn’t there.

    That division is taking up its maximum amount of available space like it is expected too. The floated content is only pushing the content, which at this point, there isn’t any. Making your sidebar partially opaque, this issue becomes visible as you can see that box behind your image now. A quick fix, per say, would be to add a margin to the division to push it out from behind the sidebar, like so:

    .header {
        margin-left: 173px; /* The width of your sidebar */
    }
    

    Note, however, that you would have to apply this margin to the left side of all your block-level elements that need pushed out from under. So it would make sense to put all the right content into a single box that gets pushed out, to prevent confusion.


    Edit: The reason your black background doesn’t pull through on the sidebar image is that you’re setting it’s background to light grey here:

    background: url('side1.png') lightgray 10% 50%;
    

    This will put a light grey background behind the image rather than letting the transparent part of your image go through to whatever is behind it. Try removing it:

    background: url('side1.png') 10% 50%;
    

    See the jsFiddle example.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How to create a .png image in gnuplot to see no spaces between graph
I have a PNG image in an BufferedImage and I would like to lower
I add a PNG image to a word 2010 document like this: var imagePart
How to show a .png image in a window in wxPython?
I have a pattern (.png image 4x4px) and have to fill the layout with
I created an .png image from a video using ffmpeg tool and i want
I have a PNG image that has an unsupported bitmap graphics context pixel format.
I am generating a .png image that contains a text dynamically written. I need
I have several png image files with names like this - house_number_5.png house_number_512.png house_number_52352.png
I am using a 169.7 KB png image as a backgroung for my main

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.