IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 1 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Need CSS help
I'm working on a new design and I don't know if what I want is possible.

http://no-secret-rec...category/recipes/

The 8th item down has a two-line title, where all the others are one line. That makes the item below it not float left the way I want. (Display has to be set wide enough for them to be three to a row to see this.)

I could do this as a table and make each item the same height, but then if you have a narrower display (eg: mobile) it doesn't reflow to two columns, then one, like it does when using CSS.

Option 1: Flow the tiles from top to bottom in each row, rather than left to right. Not sure how to manage this without setting explicit column counts and doing the math myself.

Option 2: Dynamically reduce the font size to always be less than X no matter how many lines it takes up.

2a: Set an overflow property and just cut it off, let the tooltip display the full title.

Option 3: Increase the height of the other elements (all? all on the same row?) to match the size of the largest.

I used to work with some of those options in PDF, but haven't seen anything similar for CSS. Anyone seen an example?
--

Drew
New Found a solution
http://www.metaltoad...ext-fit-container

I also discovered the vw measurement that's now available in CSS. Woot!
--

Drew
New Interesting.
I would think it would be annoying to have to whip out javascript to do something that seems like it should be native to CSS. But it must be satisfying to make the page do what you want in spite of the language limitations!

Cheers,
Scott.
New My "solution" needs more work
The script I found assumes there's only a single instance of the element you want to adjust. They should have used an ID instead of a class to make that clear. As written, it adjusts all the elements of that class (makes sense once I figured out why it wasn't working) based on whether the first element fits in its container.

I'll have to build a walker to traverse all the elements and adjust each one individually. That can wait a bit.
--

Drew
New The plot thickens! :)
Alex

“There is a cult of ignorance in the United States, and there has always been. The strain of anti-intellectualism has been a constant thread winding its way through our political and cultural life, nurtured by the false notion that democracy means that "my ignorance is just as good as your knowledge.”

-- Isaac Asimov
New Instead of floating
Set category_header to display: inline-block.

Also, set width: 162 instead of max-width. Otherwise, that same caption will cause that one element to grow to 162 resulting in a bulge on the right side.


New DUDE! YES!
I owe you a beer.
--

Drew
New Yay!
In case you want to get rid of the vertical bump, you can try "display: table-cell" instead of inline-block, but you may have to embed the panels by threes in a div. Plus, the browser from Redmond may ignore you depending on the version.
New Not sure what bulge you mean?
--

Drew
New Re: Not sure what bulge you mean?
The box with the split line is taller than its neighbors.
New The height, yes ... but you mentioned width vs max-width?
--

Drew
New Ah. No, different bulge.
max-width allowed the text to widen the box and cause the row to poke out the right side. It stuck out like a sore thumb when scrolling down.

The difference in height is less noticable and harder to address, so I didn't touch on it in the original response.
New I don't see that happening in Firefox
What are you using, and which page are you seeing it?
--

Drew
New Hmmm...
Debian Wheezy's Iceweasel (aka FF 17) on a Toshiba Satellite A215. 1280x800 screen.

I saved a local copy of the page you posted to test things. That may have had something to do with it, although the rest of that page section looked OK. I've shut it down for the night. I'll see if I can reproduce things tomorrow.
New 't was an artefact. The saved page used a different font.
New Cool, thanks for the follow-up
--

Drew
     Need CSS help - (drook) - (15)
         Found a solution - (drook) - (3)
             Interesting. - (Another Scott)
             My "solution" needs more work - (drook) - (1)
                 The plot thickens! :) -NT - (a6l6e6x)
         Instead of floating - (scoenye) - (10)
             DUDE! YES! - (drook) - (9)
                 Yay! - (scoenye) - (8)
                     Not sure what bulge you mean? -NT - (drook) - (7)
                         Re: Not sure what bulge you mean? - (scoenye) - (6)
                             The height, yes ... but you mentioned width vs max-width? -NT - (drook) - (5)
                                 Ah. No, different bulge. - (scoenye) - (4)
                                     I don't see that happening in Firefox - (drook) - (3)
                                         Hmmm... - (scoenye)
                                         't was an artefact. The saved page used a different font. - (scoenye) - (1)
                                             Cool, thanks for the follow-up -NT - (drook)

Not such a bad thing, to be farmed by rats...
71 ms