views:

243

answers:

2

Hi, I wondered if someone could help.

I need to build a system that pulls numbers out of an array and displays them in a cloud like pattern (a range of different sizes and colours). I'm stumped on how to build a system to create the divs so they don't overlap and make a nice tight structure. Any pointers would be great.

Mock Up: http://img228.imageshack.us/my.php?image=example.png

+1  A: 

I imagine you should look at some of the tag cloud generation mechanisms flying around out there and see how they do their business.

chaos
Hi I have done but none that I can find do anything in regards to making the elements closer to one another so it looks visually better, typogrpahically. I will continue to dig however
If I were trying to do that, I'd start by playing with the margin, padding, line-height and letter-spacing CSS properties on the divs.
chaos
A: 

Isn't that the purpose of the margin in CSS?

I should imagine that setting a 1-px all-round margin will make sure that no div is less than a pixel from another.

Lansen Q
The problem is the random placement, spacing, and sizing of each tag. CSS is still very grid-centric. Looking at his mockup, think of each tag enclosed in a box. All those gaps and overlaps that result would be tricky to pull off in CSS alone.
Mark Hurd