[SOLVED] Comments breaking free of the maincontent div and strectching the entry page.

Mar 18, 2006 04:07

Hi!
I'm usually lurking around to see what's going on but never tried to go farther than fixing my layout using an external stylesheet. However since I've got a freshly bought paid account, I've started thinking of things I'd like to fix in my flexible square layout. Horizontal scrollbars irk me to no ends, and while I appreciate that in flexible square the comments don't end strecthing the layout, they do stretch the page horizontally, causing this dreaded horizontal scrollbar to appear.

After looking to the source where I tried to spot the function responsible for printing the comments, I searched the comm and already found this entry, where kunzite1 explained how to fix a limit for collapsing comment threads ( this comment and the one below it) but it's not exactly what I'm looking for, as collapsed comments still continue to gain margin and thus, continue to break free of the maincontent div.

What I wish to do is actually fixing a limit to the incremental margin of the comment to prevent the comments to break free of the maincontent div. Eventually, also add a switch in the comment's header bgcolor (dependent of the comment's depth maybe?) to try keep a difference between comments, principaly to avoid confusing the reader due to the comments suddenly being all at the same level.

For conveniency purpose I copy/paste-ed the code kunzite1 gave in the entry I linked above inside the cuts, along with my ideas on how to implement it. I edited that part out since I think it may confuse people looking for the solution.

How I see this:
- Stopping the indenting:
test the comment's depth, if superior to the fixed limit, assign a fixed width for the margin else use the method used up till now in the original code.
- changing the background of the comment's header:
test the comment's depth, if superior to the fixed limit, assign another class depending of the depth value.
Use CSS to style those new classes.

I hope I've not been too confusing and that this problem may interest one of the fantastic people here.

[SOLVED] Many many thanks to afuna an murklinstest for their effort and kindness :D Again, thank you so much, the both of you :D

See those three threads for the code they came up with.
- The merged result of their code without code coloring.
- Code coloring of the first part of the code [the styling]
- Code coloring of the second part of the code [the function] and the explanations for this are here

comments, solved, paid accounts

Previous post Next post
Up