Having a problem here with vertically aligning images and text within a <div>. I have a loop that is running to display a users thumbnailed images within their gallery on my image hosting site. However, not all thumbnails are the same height, causing it to look stagard within each row. So my solution to make it look "nicer" would be to vertically align the contents of each <div> centered.
I know the first thing your going to say is use <div style="vertical-align:middle">, but I have tried this and it isn't working, which I do not understand. Also, looping <td>'s would be insufficient since they won't break down to another row when space runs out on the current row. They would just keep going out into one single row.
My code is pasted below of the entire section that is being looped (loop begins within the {{section}} tags). Any helps/tips would be helpful.
Location: Splendora, Texas, United States of America
Posts: 2,887
Thanks: 5
Thanked 186 Times in 183 Posts
I just tested that code in Firefox 1.5.0.2 to make sure and it does indeed work. Your box needs to be bigger than the content for it to have any effect however; this means that your height property needs to be specified and set to a size taller than the content for it to work.
__________________
Please for the love of god stop making IE. You current "browser"s cause me to cry every day. —Phil *
Location: Splendora, Texas, United States of America
Posts: 2,887
Thanks: 5
Thanked 186 Times in 183 Posts
Just to note, if you use Kravvitz' code you may want to use a conditional comment to issue commands to MSIE instead of the star-html hack since they're fixing that hack in IE7.
__________________
Please for the love of god stop making IE. You current "browser"s cause me to cry every day. —Phil *
Just to note, if you use Kravvitz' code you may want to use a conditional comment to issue commands to MSIE instead of the star-html hack since they're fixing that hack in IE7.
You don't have to. The comment before the doctype on that page puts IE6-7 in backwards compatibility mode (aka quirks mode). In backwards compatiblity mode IE7 support the star html hack; in Standards mode it doesn't.
Location: Splendora, Texas, United States of America
Posts: 2,887
Thanks: 5
Thanked 186 Times in 183 Posts
Quote:
Originally Posted by Kravvitz
You don't have to. The comment before the doctype on that page puts IE6-7 in backwards compatibility mode (aka quirks mode). In backwards compatiblity mode IE7 support the star html hack; in Standards mode it doesn't.
Ah, interesting bit of information; didn't know that.
That is assuming that he wants to display his web page in quirks mode though which in and of itself can cause browser-compatibility problems.
I missed this yesterday, but at the top of your X/HTML code you have a note that says "A loop for each thumbnail", which leads me to believe that you have non-unique IDs which would cause problems.