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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:45:31+00:00 2026-05-17T01:45:31+00:00

I have the following html which I want it to be viewed exactly opposite

  • 0

I have the following html which I want it to be viewed exactly opposite to what it looks like now, but I’ve tried a lot and nothing goes well, to be specific I want the A link to be on the top of the links, and the B one right under it, and the C one right under B, and so on…
I’ve tried to set the z-index to them but it hasn’t worked.
please explain to me my fault.

HTML:

<html>
<head>
    <title>Test page</title>
    <link href="style.css" type="text/css" rel="Stylesheet" media="screen" />
</head>
<body>
    <div class="d1">
        <a href="#" class="a1" style="background-color: #000;">A</a>
        <ul class="b1">
            <li>
                <a href="#" class="a2" style="background-color: #222;">B</a>
            </li>
            <li>
                <a href="#" class="a2" style="background-color: #444;">C</a>
            </li>
            <li>
                <a href="#" class="a2" style="background-color: #666;">D</a>
            </li>
            <li>
                <a href="#" class="a2" style="background-color: #888;">E</a>
            </li>
        </ul>
    </div>
</body>
</html>

CSS:

div.d1
{
    width: 100px;
    height: 160px;
    float: left;
    margin: 0 auto;
    padding: 10px 50px 15px 50px;

    background-color: Red;
}

a.a1
{
    display: block;
    width: 100px;
    height: 130px;
    float: left;

    margin: 0 auto;
    padding: 30px 0 0 0;
}
a.a1:hover
{
    color: Red;
}

ul.b1
{
    display: block;
    width: 100px;
    float: left;

    position: relative;
    left: 25px;
    top: -160px;

    list-style: none;
    margin: 0;
    padding: 0;
}
ul.b1 li
{
    display: block;
    width: 25px;
    height: 160px;
    float: left;
    z-index: -1;
}
ul.b1 li a.a2
{
    display: block;
    width: 100px;
    height: 130px;

    margin: 0 auto;
    padding: 30px 0 0 0;
}
ul.b1 li a.a2:hover
{
    color: Red;
}
  • 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-17T01:45:31+00:00Added an answer on May 17, 2026 at 1:45 am

    You need to give the <a> positioning, because for z-index to work it requires the positioning to be set to a value other than static, easiest to do by setting it’s position to relative

    Example: http://jsfiddle.net/2JsvU/

    a {
        position: relative;
        z-index: 5;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have the following html , and i want to hide all lsHeader which
Assuming I have the following html div which I want to replicate its children,
I have following HTML code. writer input field is text filed. but I want
I have following html and css code in which I want <a> tag to
I have following HTML output which i can not change. I want to specify
I have the following HTML, which I could change, but would prefer to keep
I have the following html structure (which is generated and I can't change): <table
I have HTML which includes scripts in following order <script src=../static/js/jquery.js type=text/javascript> <script src=../static/js/bootstrap.js
I have a simple FAQ page in which each item has the following HTML
I have a header.html which start with session_start();. Then the following code, $_SESSION['cart'][$sw_id] is

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.