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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:47:07+00:00 2026-06-11T01:47:07+00:00

I have this situation using CSS. I want an image to be in the

  • 0

I have this situation using CSS.

I want an image to be in the center of the screen, doesn’t matter the size of the screen, always in the middle. That’s pretty easy to do.

But, the image (.png) I want to be in the middle is black and has some transparent letters in it.

So, I want the whole screen to be black, but still have transparent letters in the middle of the screen.

The reason I want transparent letters is because I’m using a script to fill the letters while the page is loading. The idea is based on a progress loading bar, but in this case, using letters as the ‘bar’.

How can I achieve that? I have tried surrounding the image with divs but it’s not the best way since depending on the screen size, some divs may not reach the image and left a blank space.

What do you suggest? What should I read?

Just in case I didn’t make myself clear, here is an image:

Help Image

  • 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-06-11T01:47:09+00:00Added an answer on June 11, 2026 at 1:47 am

    The best option I can currently think of, to black out the screen around the centered img is to use box-shadow:

    #main {
        position: absolute;
        top: 50%;
        left: 50%;
        margin: -250px 0 0 -250px;
        box-shadow: 0 0 0 500px #000;
    }​
    

    JS Fiddle demo.

    This does, of course, require that the browser supports the box-shadow property (or at least one of the vendor-prefixed implementations), and also takes a fairly arbitrary number for the ‘spread’ of the blur.

    Unfortunately, while I’d rather use the border property the border affects the layout and must be compensated for in positioning the img, whereas the box-shadow doesn’t affect the layout of the page.

    With this demonstration, obviously, the background-color should be replaced by a background-image or whatever alternative you’re using to represent the loading bar.

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

Sidebar

Related Questions

The Situation (Ignore this it is boring): I have reports that I created using
I have a feeling that this probably is not possible using strictly CSS, but,
Using this file as source, I have a situation where I need to retrieve
I have this situation where I want to display a list of Administration objects
I have a DOM situation that looks like this: A is an ancestor of
I have this situation: $(#button).toggle(function(){ $(#window).animate({top:'0%'},1000); },function(){ $(#window).animate({top:'-100%'},1000); }); but I need change it
I have this situation: http://jsfiddle.net/bRDgK/3/ In this situation I have a modal dialog with
I have this situation: { float foo[10]; for (int i = 0; i <
We have this situation: Window Keyboard ^ ^ | / ApplicationWindow so class Window
I have this situation: interface MessageListener { void onMessageReceipt(Message message); } class MessageReceiver {

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.