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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T04:15:00+00:00 2026-06-08T04:15:00+00:00

In this jsfiddle , I am trying to create a DIV that expands and

  • 0

In this jsfiddle, I am trying to create a DIV that expands and collapses as you click its title. The title is positioned on the top border, almost like a legend tag of a fieldform. I would like for the top border of the DIV to remain when the box is collapsed.

If you check out my jsfiddle, you’ll see it functions pretty well. However, the border of my container box must be turned off in order to achieve this effect. As a result, the contents of my title shift to the left. They are shifting the same amount of pixels that the left border of the outer DIV was in width.

I’ve tried a few things to compensate for the shift because I would like for the text to remain in the same position while the top border remains in its original position as well, but no luck so far. Does anyone have any ideas?

  • 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-06-08T04:15:01+00:00Added an answer on June 8, 2026 at 4:15 am

    This one lets the legend stay where it is but cuts the border on the left and right side:

    .boxContainerHidden {
        padding-left:        0px;
        border:              2px solid transparent;
        border-top-width:    0px;
    }
    

    Try it: forked fiddle

    This one lets the legend stay at its position and does not cut the border:

    .boxContainerHidden {
       height:           1px;
       border:           solid #ffffff;
       border-width:     2px;
       border-top-width: 0px;
       border-bottom:    0px;
    }
    

    Try it too: forked fiddle

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

Sidebar

Related Questions

I am trying to create div that contains scrollable content. To do this I
Im trying to create a 3 column DIV that allows me to resize the
I have created this jsfiddle: http://jsfiddle.net/mfnxm/1/ I am trying to create this JSON: [{
I'm trying to create two side-by-side div elements, but I found that having an
jsFiddle In this HTML/CSS, I am trying to create some containers which will hold
Having some issues trying to create a fixed header layout for this jsfiddle: http://jsfiddle.net/4xk4D/107/
I am trying to create a fixed div, so that even if i scroll
im trying to create this function in javascript but its not working, im a
I have been trying to get this jsfiddle to work. So far without luck.
As you can see in this jsfiddle , I'm trying to make a toggle

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.