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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:00:43+00:00 2026-05-27T17:00:43+00:00

I am creating a website and need two images to overlay on top of

  • 0

I am creating a website and need two images to overlay on top of each other, with the top image being centered, however I also need the entire block to be centered in the page so I don’t think I can use absolute positioning as I need the page to be scale-able.

I am using –

img.center {   display: block;   margin-left: auto;   margin-right: auto; }

To center images on the page.

Im not sure if I have explained this very well so hopefully the following mock-ups will help.

enter image description here

enter image description here

I have looked around into image overlaying but they all seem to use absolute positioning and I cant seem to make it work so that the images are always centered using that method.

Is there anyway to do this? if some some example code would be extremely helpful, or just a point in the right direction.

Thanks.

  • 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-27T17:00:44+00:00Added an answer on May 27, 2026 at 5:00 pm
    <div class="img_cont">
        <img src="1.png" alt="" class="first"/>
        <img src="2.png" alt="" class="second"/>
    </div>
    <style type="text/css">
        div {
            width: 300px;
            height: 300px;
            position: relative;
                margin: 0 auto;
        }
    
        .first {
            width: 100%;
            height: 100%;
        }
    
        .second {
            position: absolute;
        }
    </style>
    <script type="text/javascript">
        $(".home_click").css("left", ($(".img_cont").width() - $(".second").width()) / 2 + "px");
        $(".home_click").css("top", ($(".img_cont").height() - $(".second").height()) / 2 + "px");
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a website and I need to style some boxes like this image
I am creating a website for funny images. Those images are stored in a
I'm creating a website and I want it also to be prepare for mobile
I am creating a website with four textarea forms. Each form has a word
I'm creating a fairly simple website. There are two static pages (Home and Portfolio)
I am creating a website where videos need to be streamed. The content creator
I am new at C#/.net programming and am creating a example website.I need the
I'm currently creating a PHP website where users need to be able to upload
I'm creating a tshirt website and I need to be able to have a
I am working on creating website with Yii framework and I have a problem

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.