[英]In IE7 How to vertically align the text to bottom which is in fixed height container
HTML:
<div class="testing">
<div class="a0"><p>Monday, 07 May 2014 00:00 AM</p></div>
<SPAN class="a1"><SPAN CLASS="b1">abc</SPAN></SPAN>
</div>
<div class="testing">
<div class="a0"><p>Tuesday, 07 October 2014 00:00 AM</p></div>
<SPAN class="a1"><SPAN CLASS="b1">abc</SPAN></SPAN>
</div>
CSS:
<style type='text/css'>
body {
font: 12px/1.136 arial,verdana,sans-serif;
}
.testing {
width: 245px;
border: 1px solid red;
background-color: grey;
height: 25px;
}
.a0 {
display: inline-block;
width: 70%;
float: left;
background-color: green;
vertical-align:bottom;
}
.a1 {
float: right;
line-height: 25px;
}
.b1 {
display: inline-block;
height: 20px;
vertical-align: bottom;
}
p {
margin: 0;
display: table-cell;
height: 25px;
vertical-align: bottom;
}
</style>
如果在FF或其他浏览器中看到,则“ .a0 p”和“ .a1 .b1”中的文本在底部对齐。 尽管“ .a0 p”中的内容长或短,但文本在底部对齐。
问题是IE7,在两种情况下我都无法将这两个内容底部对齐。
我的限制是:1.“ .testing”容器必须具有固定的高度,因为它们将彼此并排放置,因此应显示相同的高度。2.右侧的内容不会改变,而左侧的内容可能会更短(仅在一行中)或更长(可能在下一行中换行)
有什么想法可以解决IE7中的对齐问题?
您是否尝试过从显示中更改.a0(等):inline-block; 显示:表格;?
如果这弄乱了您的布局,请考虑将.a0包装在带有内联块的容器中。
行高方法不适用于IE7。 请参阅http://css-response.com/alignment/中的支撑解决方案
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.