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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:33:37+00:00 2026-05-16T17:33:37+00:00

I’m having a strange problem with anchor tags shifting divs upwards which is causing

  • 0

I’m having a strange problem with anchor tags shifting divs upwards which is causing quite a bit of headache, but because there are so many different pieces in the mix, I don’t know which one is causing the issue. I’m attempting to build a UI that uses a modal dialog box from the jQuery UI library to display a horizontal accordion style menu. The basic format of the code is as follows:

<div id="identifier" class="profilePanel">
   <ul>
      <li>
         <div class="card">
             <div class="header"><h1>Header</h1></div>
             <div class="content">
                 <!--Content goes here! -->
             </div>
         </div>
      </li>
      <li>
        ...
      </li>
   </ul>
</div>

Each card is designed so that when you click on it the currently expanded card shrinks in width and the new card grows in width. This is all done in javascript assisted by jQuery. Each cards additional content is hidden via overflow:hidden in the css, and only the header div within the card is visible when shrunk. The relevant css is as follows:

ul {
list-style: none;
margin: 0;
padding: 0;
}

div.profilePanel {
    display: none;
}

div.profilePanel li {
    float: left;
}

div.profilePanel li div.card {
    overflow: hidden;
    height: 375px;
    width: 30px;
    background-color: #e0f3fb;
    padding: 0px 2px 2px 0px;
}

div.profilePanel li p {
margin: 0;
padding: 0;
display: block;
margin-left: 35px;
}

div.header {
    border-width: 1px;
    border-style: solid;
    border-color: red;
    display: block;
    float: left;
    width: 30px;
    height: 100%;
    cursor: pointer;
}

div.content {
    padding: 5px 10px;
    height: 365px;
    overflow: auto;
}
div.content li {
    display: block;
    float: none;
}

h1 {
    float: left;
    -webkit-transform: rotate(-90deg);
    -moz-transform: rotate(-90deg);
    direction: rtl;
    font-size: 14pt;
    margin-top: 5px;
    white-space: nowrap;
    width: 30px;
    text-align: center;
    overflow: visible;
}

Now if the content div contains no anchor tags (ie. I could take anchor tags and rename them to spans to get the proper formatting if not functionality) the menu displays as expected. Each header takes up the entire card size, and everything is properly formatted within the cards. However, if the content div contains an anchor tag, both the header and content divs are shifted up on the page. Using firebug, I can tell that the card div has actually not moved, but the header and content ones have. Since this is in a modal dialog box, I thought it had something to do with that but the two divs seem to be shifted in relation to the position of the dialog box no matter where I drag it to.

  • 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-16T17:33:38+00:00Added an answer on May 16, 2026 at 5:33 pm

    First off, I am assuming that somewhere in your HTML you have a DIV with a class of profilePanel.

    I am also assuming there aren’t any CSS rules that affect an anchor’s position, i.e. a {margin-top:20px;}

    Now I may be mistaken here, but I think you are using the wrong CSS Property. I would think it would be better to use display:none instead of overflow. Display:none literally hides the element while overflow:hidden only hides the content of an element that exceeds its size.

    However, without seeing the JavaScript I’m not able to tell you what the real issue is.

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

Sidebar

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.