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 6905579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:12:03+00:00 2026-05-27T08:12:03+00:00

I created a small lightbox script, the script itself works fine but the problem

  • 0

I created a small lightbox script, the script itself works fine but the problem is that the lightbox class which is filling up the whole screen needs to be translucent and if I make it that, the lightbox-image becomes translucent as well. I tried adding opacity: 1; to the lightbox-image but it didn’t work. Can you help?

The HTML looks like this:

<div class="lightbox">
    <div class="lightbox-image">
        <p>Something here</p> 
    </div>
</div>

CSS:

.lightbox {
    display: none;
    position: absolute;
    width: 100%;
    top: 0;
    left: 0;
    height: 100%;
    background-color: #000;
    z-index: 1000;
    opacity: 0.9;
    filter: alpha(opacity=90);
}

.lightbox-image {
    position: fixed;
    display: none;
    width: 600px;
    text-align: center;
    z-index: 1001;
    background-color: #000;
    margin-top: 100px;
    margin-left: auto;
    margin-right: auto;   
}
  • 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-27T08:12:04+00:00Added an answer on May 27, 2026 at 8:12 am

    You can’t because the parent has opacity:0.9 , so all the children will inherit this property (and you can’t assign different opacity to children). You could use as background-color an rgba i.e.

    .lightbox
    {
        display:none;
        position:absolute;
        width:100%;
        top:0;
        left:0;
        height:100%;
        background-color:rgba(0,0,0,0.9);
        z-index:1000;
    }
    

    …and, as a fallback (i.e. for IE 😀 ) a transparent repeated 1px image

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

Sidebar

Related Questions

I created a small program in PHP which sends newsletter. It's fine when I
I created a small shell script which logs all of it's input to a
I created a small function that simply writes text to a file, but I
I created a small chat program, that works flawlessly when client & server are
I have created a small php script locally that runs a java application in
I have created a small Java application in which there is some code that
I've created a small python script to toggle between two files I'm using for
I have created a small flash CS4 project that has a few custom components
I have created a small application which opens,reads and creates Excel files. The app
The organization I work for has created a small flash widget that we're encouraging

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.