I've been trying to find the bug on my site http://goo.gl/UOCY and can't figure out where the problem comes from, one of the testimonial boxes won't align to the rest of the testimonials boxes, I need help to fix it, I really have no idea of what I'm missing there. Thanks
views:
85answers:
3
A:
seem that not have enough width (decrease 35% to 31%)
if you change it to this
div.testimonial {
float:left;
margin:10px;
width:31%;
}
its work!
Haim Evgi
2010-10-18 12:19:01
That will work only for this particular case, not for arbitrary set of testimonials.
Nikita Rybak
2010-10-18 12:22:58
+3
A:
you have two options:
- use a fixed height for all the testimonals. I tried
159px
and it works and looks ok. Of course that means for any future testimonials that may have a lot more text it will break. - better option: every alternate (even, i.e. 3rd, 5th, 7th etc.) testimonial div, add a class called
odd
so yourdiv
now looks like<div class="testimonial odd">
and then do this in the CSS:.testimonial.odd { clear:left }
. note the lack of space between the two classes in the CSS.
Moin Zaman
2010-10-18 12:27:36
Thanks @moin,but unfortunately, the second solution is not working for me, it just list everything in one row.
2010-10-18 15:19:36
can you please try it for odd divs as i've shown in my updated answer?
Moin Zaman
2010-10-18 20:36:06
A:
Two solutions come to mind:
Clear every second testimony. You can do this by either adding a class to every second testimony, or with the CSS3 nth-child
selector. The code would look something like:
div.testimonial:nth-child(odd), div.testimonial.clear {
clear: both;
}
Split the testimonials into two columns. Putting them into two different div
, each of them floated with 50% width.
Yi Jiang
2010-10-18 12:31:29