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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:31:34+00:00 2026-06-15T16:31:34+00:00

Currently I have something like this . The Page and Row elements are created

  • 0

Currently I have something like this. The “Page” and “Row” elements are created dynamically using javascript.

The problem rises when there are multiple Pages, and a Row in the Page 1 is deleted, for example. The empty space should be filled by the element that is below, if the empty space is at the end of the page, then the first element of the next page should fill the empty space, and so on. At the end it should look like this.

I can solve this rearranging/recreating the entire PageCont.

Is there a way I can achieve this using pure CSS? So the rearranging would be handled by the rendering engine of the browser.

Something like this inline-block but with vertical direction.

Any help is highly apreciated.

​HTML:

<div class="PageCont">
    <div class="Page">
        <div class="Row">1</div>
        <div class="Row">2</div>
        <div class="Row">3</div>
        <div class="Row">4</div>
    </div>
    <div class="Page">
        <div class="Row">5</div>
        <div class="Row">6</div>
        <div class="Row">7</div>
        <div class="Row">8</div>
    </div>
    <div class="Page">
        <div class="Row">9</div>
    </div>
</div>​

CSS:

.PageCont
{
    height: 300px;
    width: 350px;    

    border:2px solid red
}

.Page
{
    float:left;
    margin-left:10px;
}

.Row
{
    height:50px;
    width:50px;

    background-color:blue;
    color:white;
    margin-top:10px;
}

​

  • 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-15T16:31:36+00:00Added an answer on June 15, 2026 at 4:31 pm

    The operation could be successfully performed trivially if it included horizontal wrapping, with plain simple CSS. However since this case involves vertical wrapping javascript be necessary with your current implementation. If you were to use columns you wouldn’t need the javascript and CSS is all that’s needed.
    Here is a fiddle where I’ve implemented it http://jsfiddle.net/eQvaZ/

    The HTML is as follows:

    <body>
        <div class="pageCont">
            <div  class="Row">C1</div>
            <div class="Row">C2</div>
            <div  class="Row" id="to-remove">C3</div>
            <div  class="Row">C4</div>
            <div  class="Row">C5</div>
            <div  class="Row">C6</div>
            <div  class="Row">C7</div>
        </div>
        <div>Removing C3 in 5 seconds...</div>
    </body>
    

    The CSS:

    .pageCont{
        column-count:2;
        column-rule:0px;
        -webkit-column-count: 2;
        -webkit-column-rule: 0px;
        -moz-column-count: 2;
        -moz-column-rule: 0px;
        padding:10px;
        height: 250px;
        width: 200px;
        border:2px solid red
     }
    
    .Row {
        height:50px;
        width:50px;
        background-color:blue;
        color:white;
        margin-bottom:10px;
     }
    

    The bit of JavaScript to remove an item:

    setTimeout( function(){
    var to_remove = document.getElementById('to-remove');
    to_remove.parentNode.removeChild(to_remove);
    }, 5000);
    

    Let me know if you have any questions regarding this implementation.

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

Sidebar

Related Questions

I have something like this currently: <div class = className style = position: absolute;
I currently have a table structure that looks something like this(some details omitted): ColumnName
I currently have service classes that look something like this public class UserService :
I would like to ask something about query using mysql I have this table
I currently have a login link on my application that looks something like this:
Currently, I have something like: public partial class Form1 : Form { delegate void
Currently I have a site where it has a header that looks something like
Hopefully I'm just missing something and this is simple... I have a page that
In my Rails controller I have something like: def authenticate_user! if not current_user #
Very simple + silly question: Does clojure provide multi maps? I currently have something

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.