Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CSS positioning question

Status
Not open for further replies.

paket

Programmer
Jun 6, 2001
7
CA
I'm working on a database-driven site, and I would like to use CSS to position the web elements, but I seem to have run into a wall. This is what I am trying to do:

section 1 -------------------------
{dynamically-generated elements postioned wrt section 1's upper left}
end of section 1-----------------------------

section 2 ----------------------
{dynamically-generated elements postioned wrt section 2's upper left}
end of section 2 ---------------

section 3 ------------------
{dynamically-generated elements postioned wrt section 3's upper left}
end of section 3 -----------

Looks to be fairly simple, but the catch is that the elements are dynamically generated from a database and I don't know beforehand how many there will be and how big to make each section. I guess what I would like to do is to position according to the BOTTOM edge of a section, not the top.

I've tried this:
<div>
{dynamically generated elements positioned using position:relative}
</div>
<div>
{dynamically generated elements positioned using position:relative}
</div>

but the dynamically generated elements seem to 'overflow' outside of the area that I think should be contained by the <div> tags.
Does anyone know how to accomplish this?


 
I'm working off the premise that you'd like to know how many elements are in a section before you display it on the page.

Could you read the data for each section into section arrays before you display the page? You'd then know how many elements you have in each section and could presumably allocate sufficient space for them.


Good luck,
Todd
 
Yes, that would be possible. I would have to do some finagling to work out the spacing along with font sizes, but that should work.
I was hopeing for a simpler solution, but I can always go with that.
thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top