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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:48:01+00:00 2026-06-17T19:48:01+00:00

The Context: I’m building out a div roster to use with jQuery or PhP

  • 0

The Context:

I’m building out a div roster to use with jQuery or PhP for my roleplaying Star Trek Fleet (nerdy, yes, I know). I need my divs to behave in certain ways to make it robust enough to pull from XML and generate the roster automatically and auto-size my divs to fit however many names are added.

It will help to take a look at my current build example with Firebug/the like to understand what I’m doing.


Requirements:

Each subsection (Outpost Personnel, Outpost Defense), needs to have a number of divs:

1) The background image & subsection container (div id= outpostPersonnel in this example)

2) Sub-sub section container for each side of the listing, left and right. (Think newspaper paragraph.)

3) The top n number of roster names needed to fill/align to that background image in requirement 1. (div id= initialCommandTags (left side listing) and initialPersonnelTags (right side listing))

4) Div that stretches with n number of additional roster names. (div id = overflowCommandTags, overflowPersonnelTags, )

5) A colour div stripe to make it look like LCARS is still encapsulating the n number of roster names from requirement 4. (div id = colorStretchLeft)


The Problem:

I cannot get the parent subsection- the div from 1 (outpostPersonnel) to adhere exactly to the height of ALL its child divs- all the way down to the height of the overflowCommandTags/overflowPersonnelTags div.

One way I’ve tried it, and the next subsection (Outpost Defense) overlaps the overflowCommandTags div. The other- which is the way I have my example now (and where I gave up)- puts a ~160 pixel high blank space between the end of the overflowTags div and the top of the next subsection (outpostDefense).

If you firebug my current build example, you’ll see that the parent div (outpostPersonnel) extends way the heck down, even though none of its child divs are that tall.

Overflow:auto and Overflow:hidden are NOT viable solutions insofar as I have read, since I need the divs to expand fully, and WITHOUT a scrollbar.

I’m completely stumped. Watch it be a really simple solution, too. Is it something to do with the fact that the parent div is only a BG, while the child divs have actual content?

Thank you for bearing with me this far!
Cheers!

((Also the reason why my div style stuff is in-line is because I’m embedding this on an Enjin page and I can’t call a *.css file.))

  • 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-17T19:48:03+00:00Added an answer on June 17, 2026 at 7:48 pm

    There are a few things to mention here but I’ll start with the reason for the gap in between the two sections.

    From what I can see from your inline styles you have used position: relative and varying top andleft values to achieve the desired layout. On the element with ID personnelContainer you have added top: -230px. This is what is causing the gap.

    When you position an element relatively you have to imagine that the element is in its original position and that you’ve just visually moved it. In other words, moving the element does not change the flow of the page, so applying the negative top value as in your example will not change the height of the container. (good reference: http://reference.sitepoint.com/css/relativepositioning)

    With this in mind, you could go the route of applying minus top values to each of the sections that follow in order to close the gap, however you are likely to find that this complicates matters further and leads to overlapping content.

    The best advice I can give is to read the following articles on floated layouts:
    http://css-tricks.com/all-about-floats/
    http://www.quirksmode.org/css/clearing.html

    Relative positioning has its applications but in this case you should use the float property to achieve your layout. If you read the articles above it will give you a good grounding in floated layouts and how to ensure your sections contain everything correctly. As long as you don’t set any fixed heights on any of the child elements you will find they expand to accommodate any amount of content.

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

Sidebar

Related Questions

Context I want to use JavaFx with clojure. I am aware of http://nailthatbug.net/2011/06/clojure-javafx-2-0-simple-app/ Question:
Context If I want Lein 1.7 to start out with a particular class loaded,
Context: I'm building a little site that reads an rss feed, and updates/checks the
Context PHP 5.3.x Overview After doing a code-review with an associate who uses both
Context I'm building a persistence layer to abstract different types of databases that I'll
Context: I'm just starting out. I'm not even touching the Direct3D 11 API, and
Context: I have an HTML page which makes use of HTML5 data- attributes .
Context: I want to use log4j to write audit-related logs to a specific log
Context: I am building an Add-in using visual studio 2010. One of the actions
Context: I have an application that makes heavy use of the GSL library and

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.