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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:10:00+00:00 2026-06-09T01:10:00+00:00

I am trying to overlay a div that has a background image in it

  • 0

I am trying to overlay a div that has a background image in it over a div that contains a photo using an image tag. The div with the background image is needed because a # will appear in that div over the bg image and both of those will appear on top of the photo.

In simple terms: I am trying to put a div on top of another div. Sorry I am unable to absolute path the images yet but I figure a concept will work regardless.

Code I have is:

<div id="contestLeaders">
    <div class="leader"><img src="css/images/chili-photo.jpg" width="138" height="138" /></div>
    <div class="leader"><img src="css/images/chili-photo2.jpg" width="138" height="138" /></div>
    <div class="leader"><img src="css/images/chili-photo3.jpg" width="138" height="138" /></div>
    <div class="leader"><img src="css/images/chili-photo4.jpg" width="138" height="138" /></div>
    <div class="leader"><img src="css/images/chili-photo5.jpg" width="138" height="138" /></div>
</div>
<div class="leaderRating">5.0</div>

CSS:

#contestLeaders {overflow:hidden;}
#contestLeaders .leader {float:left; margin-right:4px;}
.leaderRating {background:url(images/leader-rating-bg.png) no-repeat; width:138px; height:37px; color:#fff;font-size:18px;padding:10px 0px 0px 35px;}
  • 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-09T01:10:02+00:00Added an answer on June 9, 2026 at 1:10 am

    I suppose you want .leaderRating DIV on top of the other DIV’s with images.
    To achieve this try the following modifications:

    • put the overlaying DIV (.leaderRating) inside the main container (#contestLeaders)
    • add the following CSS styles: { position: relative; } for the container and { position: absolute; top: 0; } for the overlay

    This way you are absolute-positioning the overlay relative to the container.
    In the end, you shoud come up with the following code:

    HTML:

    <div id="contestLeaders">
                        <div class="leader"><img src="css/images/chili-photo.jpg" width="138" height="138" /></div>
                        <div class="leader"><img src="css/images/chili-photo2.jpg" width="138" height="138" /></div>
                        <div class="leader"><img src="css/images/chili-photo3.jpg" width="138" height="138" /></div>
                        <div class="leader"><img src="css/images/chili-photo4.jpg" width="138" height="138" /></div>
                        <div class="leader"><img src="css/images/chili-photo5.jpg" width="138" height="138" /></div>
    
                        <div class="leaderRating">5.0</div>
    
                    </div>
    

    CSS:

    
        #contestLeaders {overflow:hidden; position: relative; }
        #contestLeaders .leader {float:left; margin-right:4px;}
        .leaderRating {background:url(images/leader-rating-bg.png) no-repeat; width:138px; height:37px; color:#fff;font-size:18px;padding:10px 0px 0px 35px; position: absolute; top: 0; }
    
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to position an overlay over a div. I had the code
So I'm trying to overlay a map image with a transparent ninepatch Drawable using
I am trying to overlay a div over my entire page to show a
I'm trying to create a custom overlay that basically just contains a HTML element
I am trying to use flowplayer's overlay to load an external page that has
I'm trying to make a jQuery image overlay on div hover function, but I'm
I'm trying to center a div that overlays the entire image. I have a
I'm trying to figure out how to overlay a div on top of an
I am trying to overlay a moving average over an OHLC chart but it
I am trying to replicate the text overlay effect that occurs when you mouse

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.