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

  • Home
  • SEARCH
  • 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 6190011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:30:40+00:00 2026-05-24T02:30:40+00:00

I have a web page with a right floated navigation panel and content that

  • 0

I have a web page with a right floated navigation panel and content that wraps it. Content is displayed as multiple divs of same size. The problem is that the right panel is dynamic with variable height, and in most cases when a div is placed under the panel, then it doesn’t stay in the same line with its preceding divs but becomes shifted down. This in turn increases space between the lines. I want to make so that a div would be placed under the right panel only if it would stay in the same line with the preceding divs and not break the page layout. How can I achieve this? Thanks!

My HTML/CSS:

<div id="content">
<div id="navrgt">this is rigth navigation panel</div>

<div class="prodthumb"></div>
<div class="prodthumb"></div>
<div class="prodthumb"></div>
<div class="prodthumb"></div>
<div class="prodthumb"></div>
<div class="prodthumb"></div>
<div class="prodthumb"></div>
<div class="prodthumb"></div>
  <div class="clear"></div>
      </div>

CSS:

#content
{
position:relative;
border:1px solid yellow;
}

.prodthumb 
{
float:left;
margin:10px;
width:200px;
height:200px;
background-color:grey;
}

#navrgt
{
position:relative;
float:right;
right:0px;
top:0px;
width:200px;
height:50px; /*height is variable. 50px is for this example only */
border:1px solid red;
}

div .clear 
{
clear:both;
}
  • 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-24T02:30:41+00:00Added an answer on May 24, 2026 at 2:30 am

    So heres an example that works like you want, i believe http://jsfiddle.net/RshTE/

    Only thing is that i believe that IE6 wont like this.. I dont like to support ie6 anyways.

    http://jsfiddle.net/RshTE/ there are couple other downsides to this code that are shown in the example.

    But, uh… Enjoy? 😀

    I’ve never really had to do something like this so there might be a better way and i just dont know that.

    CSS:

    #wrap {
        width: 600px;
        margin: 0px auto;
        border: 1px solid #e1e1e1;
    }
    
    #sidebar {
        float: right;
        width: 150px;
        border: 1px solid #e1e1e1;
    
        height: 220px;
    }
    
    .content-box {
        overflow: auto; /* Important part */
        border: 1px solid #e1e1e1;
    }
    

    HTML:

    <div id="wrap">
        <div id="content">
            <div id="sidebar">Sidebar</div>
            <div class="content-box">Content box 1</div>
            <div class="content-box">Content box 2</div>
            <div class="content-box">Content box 3</div>
        </div>
    </div>
    

    Edit: http://jsfiddle.net/RshTE/8/ & http://jsfiddle.net/RshTE/9/

    ( Information about the display: inline; hack http://foohack.com/2007/11/cross-browser-support-for-inline-block-styling/ )

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

Sidebar

Related Questions

I have a web page that renders the same in IE7, Firefox, and Safari
Here is what I've got right now... I have a web page that when
I have a web page that includes a bunch of images. Sometimes the image
I have a web page with DIV s with a mouseover handler that is
I have a web page that displays a long line graph inside a div
I have a web page that is being displaying in a winform app using
I have a web page http://www.maryveale.com/sculpture/index.html that loads a js at /media/js/bill-studio.js that causes
I have a web page that when I run it on a remote computer
I have a web page that uses the QuickTime plugin to display a 360-degree
I hope someone can offer any help!! I have web page that initiates a

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.