我似乎找不到垂直对齐的正确解决方案。下面是标记的一块我使用(注意:我使用的角度,因此{{something}}
被替换为正确的文本):HTML垂直对齐问题
<td style="width:55%;text-align:center;vertical-align:middle">
<font size="3" color="#0B3861">
<label style="max-width:150px;background:#BDBDBD;border-radius:15px;padding:5px 10px 5px 10px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis"
title="{{Legend}}"
dir="auto">
<b>
{{Legend}}
</b>
</label>
</font>
<span type="button"
ng-model="Notifs"
ng-click="Present_Notifications()"
style="background:green;padding:0 4px 0 4px;cursor:pointer;margin:0 0 10px 10px;height:50px">
<font size="2" color="white">
<i class="glyphicon glyphicon-flag"> </i>
</font>
</span>
</td>
我得到的是:
带有白旗的绿色框应该与图例(John Smith ...)垂直对齐(中间)。
有人能告诉我我做错了什么吗?
谢谢!
使用此'margin:10px;'而不是'margin:0 0 10px 10px;' –
不可以。这并不能解决问题。 – FDavidov
我相信这可能是有用的http://phrogz.net/css/vertical-align/ – Zze