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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:46:03+00:00 2026-05-14T01:46:03+00:00

I am having some trouble with aligning two div boxes next to each other;.

  • 0

I am having some trouble with aligning two div boxes next to each other;. Or more correctly, I have aligned my two “head” boxes next to each other but my problem is that I am using them as a expand-collapse container and those boxes will not align correctly.

I am posting the entire code beneath and would be grateful if someone had a solution to this problem, which probably is not that difficult. And another problem is, that when I expand the hidden area the two boxes “resets” and again stand under each other.

<html>
<head>

<!-- Panel Slider for Contact -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" type="text/javascript"></script>

 <!-- Expand Collapse -->
    <script type="text/javascript">$(function(){
$("#mostrar1").click(function(event) {event.preventDefault();
                $("#caja1").slideToggle();
                });

$("#caja1 a").click(function(event) {event.preventDefault();
                $("#caja1").slideUp();
                });
$("#mostrar2").click(function(event) {event.preventDefault();
                $("#caja2").slideToggle();
                });

$("#caja2 a").click(function(event) {event.preventDefault();
                $("#caja2").slideUp();
                });
}); </script> 

<style type="text/css">
.slide-out-div {
       padding: 20px;
       width: 250px;
       background: #031F2F;
       margin: 0px;

    }

            #caja1 {
            width:30%;
            display: none;
            padding:5px;
            border:2px solid #FFFFFF;
            background-color:#99a8ff;
            }

            #mostrar1{
            display:block;
            width:30%;
            padding:5px;
            border:2px solid #FFFFFF;
            background-color:#0C415F;
            float: left;
            color: #FFFFFF;
            }           

            #caja2 {
            width:30%;
            display: none;
            padding:5px;
            border:2px solid #FFFFFF;
            background-color:#99a8ff;
            }

            #mostrar2{
            display:block;
            width:30%;
            padding:5px;
            border:2px solid #FFFFFF;
            background-color:#0C415F;
            float: left;
            color: #FFFFFF;
            }           
            }   

</style>
</head>
<body>

        <a href="#" id="mostrar1">Private</a><div style="display: none;" id="caja1"><a href="#" class="close">[x]</a><p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren</p></div><a href="#" id="mostrar2">Erhverv</a><div style="display: none;" id="caja2"><a href="#" class="close">[x]</a><p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren</p></div>        
</body>
</html>

Thanks
Mestika

  • 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-14T01:46:04+00:00Added an answer on May 14, 2026 at 1:46 am

    This worked for me on Firefox 3.7a. Two things changed: added a doctype and wrapped each column in a wrapper. Wrapper class could probably be named something more semantic, that’s up to you.

    <!DOCTYPE html>
    <html>
    <head>
    
    <!-- Panel Slider for Contact -->
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" type="text/javascript"></script>
    
     <!-- Expand Collapse -->
        <script type="text/javascript">$(function(){
    $("#mostrar1").click(function(event) {event.preventDefault();
                    $("#caja1").slideToggle();
                    });
    
    $("#caja1 a").click(function(event) {event.preventDefault();
                    $("#caja1").slideUp();
                    });
    $("#mostrar2").click(function(event) {event.preventDefault();
                    $("#caja2").slideToggle();
                    });
    
    $("#caja2 a").click(function(event) {event.preventDefault();
                    $("#caja2").slideUp();
                    });
    }); </script>
    
    <style type="text/css">
    .wrapper {
        width: 30%;
        float: left;
    }
    .slide-out-div {
           padding: 20px;
           width: 250px;
           background: #031F2F;
           margin: 0px;
        }
    
                #caja1 {
                display: none;
                padding:5px;
                border:2px solid #FFFFFF;
                background-color:#99a8ff;
                }
    
                #mostrar1{
                display:block;
                padding:5px;
                border:2px solid #FFFFFF;
                background-color:#0C415F;
                color: #FFFFFF;
                }
    
                #caja2 {
                display: none;
                padding:5px;
                border:2px solid #FFFFFF;
                background-color:#99a8ff;
                }
    
                #mostrar2{
                display:block;
                padding:5px;
                border:2px solid #FFFFFF;
                background-color:#0C415F;
                color: #FFFFFF;
                }
    
    </style>
    </head>
    
    <body>
    
    <div class="wrapper">
    <a href="#" id="mostrar1">Private</a><div style="display: none;" id="caja1"><a href="#" class="close">[x]</a><p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren</p></div>
    </div>
    <div class="wrapper">
    <a href="#" id="mostrar2">Erhverv</a><div style="display: none;" id="caja2"><a href="#" class="close">[x]</a><p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren</p></div>
    </div>
    </body>
    </html>
    
    • 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.