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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T13:03:23+00:00 2026-05-20T13:03:23+00:00

I have 2 images that I need to slightly overlap. My first image is

  • 0

I have 2 images that I need to slightly overlap. My first image is logo.png, and my second image is form.png

My html is:

<body id="wrapper">
  <div id="main" method="post" action="">
    <img src="images/logo.png" align="middle" id="Smarty" />
  </div>
  <div id="box" method="post" action="">
    <img id="Form" src="images/form.png" />
  </div>

And my CSS is:

 #wrapper #main {
   margin-top: 8%;
   margin-right: auto;
   margin-left: auto;
   text-align:center;
   display:block;
   z-index: 1;}

   #wrapper #box{
       margin-top: 8%;
   margin-right: auto;
   margin-left: auto;
   position: relative;
   text-align:center;
   top: 8%;
   display:block;
   z-index: -1;}

Basically I need both images to be centered relative to screen size, and I need the 2 to overlap. With this code, both images center, but my form seems to be 8% down from my logo, rather than 8% down from the top of the screen. Is this how I am supposed to be overlapping the 2, or am I way off?

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-20T13:03:24+00:00Added an answer on May 20, 2026 at 1:03 pm

    How about something like this?

    Live Demo

    Or using position: absolute, if that’s what you want:
    Live Demo

    CSS:

    #main {
        margin: 8% auto 0 auto;
        text-align:center;
    
        /* 
          only include this next rule
          if you want the first image to be over the second
        */
        position: relative
    }
    
    #box {
        text-align: center;
        margin: -12px 0 0 0;
        padding: 0
    }
    

    HTML:

    <div id="main" method="post" action="">
        <img src="http://dummyimage.com/200x80/f0f/fff" align="middle" id="Smarty" />
    </div>
    <form id="box" method="post" action="">
        <img id="Form" src="http://dummyimage.com/200x40/f90/fff" />
    </form>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have images that need to scale to the screen's size. The images will
I have some images that need to change, based not only on hover, but
I have a list of images that need to be displayed. However theres only
I'm using flex and have a few images that I need to sequence through.
I have been working on a website that has some images that I need
I need to get array of images that have to call from server and
I need to animate my background which have 6 images and that needed to
I have a set of images that when moused over need to change to
I have an image that I have in my bundle resources that I need
So here's my issue. I have an image that I need to shrink. The

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.