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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:39:18+00:00 2026-05-23T04:39:18+00:00

z-index doesnt seem to work :( I am not sure what I am doing

  • 0

z-index doesnt seem to work 🙁
I am not sure what I am doing wrong…
please help

HTML

    <div class="login">
        <div id="container">
           <!-- Hello header -->
           <div id="header">
               <h1 id="site-name">
               <img src="head.jpg" alt="header" />
                    Welcome to <br/>Blah blah</h1>
                    &nbsp;&nbsp;&nbsp;
            </div>

            <!-- end header -->


             <!--Hello Content -->
            <div id="content">
                    <asp:Label ID="lblUsername" runat="server" Text="Username"></asp:Label>
                    &nbsp;&nbsp;&nbsp;
                    <asp:TextBox ID="txtUsername" runat="server"></asp:TextBox>
                    <br /><br />
                    <asp:Label ID="lblPassword" runat="server" Text="Password"></asp:Label>
                    &nbsp;&nbsp;&nbsp;
                    <asp:TextBox ID="txtPassword" runat="server" TextMode="Password"></asp:TextBox>
                    <br /><br />
                    <asp:Button ID="btnLogin" runat="server" Text="Login" OnClick="btnlogin_Click" Width="47px"/>
            </div>
        </div>
    </div>

CSS

/* Login Box */
.login
{
    background: #b6b7bc;
}

#container
{
    background: white;
    border: 2px solid #818181;
    width: 400px;
    margin-left: auto;
    margin-right:auto;
    margin-top: 100px;
}

#header
{
    text-align:center;
}

img
{   
    z-index: -1;
}

currently when setting in img{} position to relative and z-index to 1
https://i.stack.imgur.com/XkIjk.png
want to
https://i.stack.imgur.com/d6HU8.png

  • 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-23T04:39:19+00:00Added an answer on May 23, 2026 at 4:39 am

    See the comments, the answer turned out to be:

    • Wrap just the text inside <h1 id="site-name"> in a span.
    • Use:

      #site-name {
          position: relative
      }
      #site-name span {
          position: absolute;
          top: 0;
          left: 0;
          width: 100%
      }
      

    For z-index to do anything, you need to also add position: relative.

    However, setting a negative z-index value sometimes does strange things.

    What are you actually trying to do?

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

Sidebar

Related Questions

Help me ..my page index is not working in visual studio. my page load
I've written a custom slider for this project http://dl.dropbox.com/u/18292748/Sites/enblaze/index.html and it seems to work
I'm using acts_as_solr for searching in a project. Unfortunately, the index doesn't seem to
My index.html page for my project needs some Ruby code so I need to
The tr background property doesn't seem to work in IE7. I want to make
I'm not sure if this is a jquery, javascript or simply a quirk in
I have a website that has an index.php, a few simple .html pages and
I need help on my code igniter app..i can't seem to find out what's
iam having controller like below which is not registered in routes table public class
I have this piece of code on a php page, at the bottom: window.opener.location.href=/index.html;

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.