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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T03:57:24+00:00 2026-06-09T03:57:24+00:00

First off, I must apologize. CSS positioning has always been the bane of my

  • 0

First off, I must apologize. CSS positioning has always been the bane of my existence and this is likely something simple that I’m just completely missing…

Anyway, I have a JS script that’s generating divs. Each div is within the parent #container which is absolute positioned. CSS below:

#container{
  position: absolute;
}
#container div{
  position: relative;
}

The function creating the divs is:

function newLine(){
  var id_num = ++line;
  var _new;
  var i;
  for(i = 0; i < width; i++){
    _new = document.createElement('div');
    _new.innerHTML = randomChar();
    _new.id = id_num;
    _new.style.left = i*10+'px';
    _new.style.top = 0;
    document.getElementById('container').appendChild(_new);
  }
}

Everything above is properly initialized. The left positioning works perfectly. The only issue is the vertical positioning. Instead of all the row displaying next to each other, they’re progressively increasing away from the top of the div. I’m sure this is something trivial that I’m completely looking over, but I’m stumped… Help would be very much appreciated!

  • 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-09T03:57:27+00:00Added an answer on June 9, 2026 at 3:57 am

    The rows as position: relative – this lays them out statically and then moves them the specified number of pixels. You want to use absolute positioning.

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

Sidebar

Related Questions

First off I use this code to make the navigation bar always stay fixed;
First off, I must apologize for my lack of knowledge on the subject. I'm
The code is very simple. But this is the first thing off this kind
First off, I know how to and has Integrated Windows Authentication in IIS7. This
First off, I've never used GWT before. I have good experience in HTML/CSS/JS/JSP. I'm
First off tags wont work. I say this because i create 4 buttons all
First off I am brand new to C and have been thrown into a
First off, I am not dynamically creating any controls. This is the order I
first off, this question is not related to a specific language - I use
So, first off, this is an assignment for a friend that I'm helping with,

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.