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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:07:33+00:00 2026-05-25T22:07:33+00:00

Newb question. I’m trying to use z-index, but it doesn’t seem to be working

  • 0

Newb question. I’m trying to use z-index, but it doesn’t seem to be working the way I would expect. Here’s my code:

<a id="favoritelink" href="#" style="margin-left: 600px" class="addtofavorites" title="Add to Favorites"></a>
<div class="description" style="margin-top: -18px">
   Some description
</div>

In css, I have specified a z-index for .description as 1 and for .addtofavorites as 10. #favoritelink has a background image and text that is shifted way off the page (it is essentially an image link). The background of .description still sits on top of the background for .addtofavorites.

I want the .addtofavorites background to be on top.

Here’s the css for .addtofavorites and for .description:

.description
{
    background:#efefef;
    width:600px;
    max-height:500px;
    padding:12px;
    z-index:1;
}
.addtofavorites
{
    background:url(img/plus.png) no-repeat center;
    background-size:75%;
    display:block;
    text-indent:-9999px;
    width:51px;
    height:56px;
    margin-right:6px;
    z-index:10;
 }
  • 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-25T22:07:34+00:00Added an answer on May 25, 2026 at 10:07 pm

    You have to use position: relative or position: absolute for z-index to work.

    Edit: http://jsfiddle.net/GndRj/4/
    Based on your code, but added position: relative and reduced margin-left on .favoritelink so that it shows up in the preview window.

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

Sidebar

Related Questions

This is a newb question, I know, but I can't seem to figure it
This is probably a newb question but...I was working on a db in SQSH
This might be a really newb question, but I really need help here, I
This is a pretty frustrating newb question, but I can't seem to get iteration
WP7 newb question here. I have the following code: public class KeyboardHandler : INotifyPropertyChanged
This is a complete newb question but I'm trying to run through the Lift-in-Action
This is probably quite a newb question, but I can't seem to figure it
I apologize for the newb question but have not found a solution online. I
sorry if this is a newB question, please conider the following code: #include <boost/multi_index_container.hpp>
This is a kind of a newb question but I'm really new to programming

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.