Design
The content of the information widgets should be vertically aligned in the middle as such:

Coded design
Windows: Chrome 20 / FF 14 / IE 9

Mac (Lion / Mt. Lion): Chrome / FF

The code
HTML
<div class="info"> <div class="weather display clearfix"> <div class="icon"><img src="imgs/icons/thunderstorms.png" align="Thunderstorms" /></div> <div class="fl"> <p class="temperature">82° / 89°</p> <p class="conditions">Thunderstorms</p> </div> </div> <div class="time display"> <p>11:59 <span>AM</span></p> </div> <div class="date display clearfix"> <p class="number fl">23</p> <p class="month-day fl">Jun <br />Sat</p> </div> </div>
CSS
.info { display:table; border-spacing:20px 0; margin-right:-20px; padding:6px 0 0; } .display { background-color:rgba(255, 255, 255, .2); border-radius:10px; -ms-border-radius:10px; color:#fff; font-family:"Cutive", Arial, sans-serif; display:table-cell; height:70px; vertical-align:middle; padding:3px 15px 0; } .display p {padding:0;line-height:1em;} .time, .date {padding-top:5px;} .time p, .date .number {font-size:35px;} .time span, .display .month-day, .conditions { font-size:14px; text-transform:uppercase; font-family:"Maven Pro", Arial, sans-serif; line-height:1.15em; font-weight:500; } .display .month-day {padding-left:5px;} .icon {float:left;padding:0 12px 0 0} .display .temperature {font-size:24px;padding:4px 0 0;} .display .conditions {text-transform:none;padding:2px 0 0;} .lt-ie9 .display { background:transparent; filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#20ffffff,endColorstr=#20ffffff); zoom:1; }
Problem
By looking at the above patterns of the coded pattern, you can see how the alignment seems to throw out. Upon further viewing, the text is displayed outside the element on mac.
Window

Mac

Note
I embed fonts through the Google Web Fonts stylesheet.
Verified
I tried the following:
- Set row height for each item.
- Set the font values โโfor each element.
- Set heights for each item.
- The combination of height / top layer on each element.
- Percentages used / em / px to fill.
It seems that no matter what I try, the content will never be centered perfectly compared to the Mac and PC.
My question (s)
Is it possible to achieve what I'm trying to do in a simplified way?
Should I abandon the route display:table-cell; and set specific heights / paddings for each item and child? I will still encounter problems with filling / spacing between the two OSs.
What should I classify this problem? Line height? Cell table? OPERATING SYSTEMS? etc...
Thanks in advance!
html css vertical-alignment css-tables
rebz Jul 30 '12 at 17:24 2012-07-30 17:24
source share