[英]IE9 element with text + floated right element
I have an issue with an link-element that has a right-floated icon next to it. 我在链接元素旁边有一个右浮图标的问题。 In FF/Chrome everything looks good, but in IE9 the text is at the bottom of the container, not vertically aligned. 在FF / Chrome中,一切看起来都不错,但是在IE9中,文本位于容器的底部,没有垂直对齐。
<a href="#" role="button" data-toggle="modal" class="login">
Login <span class="icon-login"></span>
</a>
.login {
line-height: 40px;
height: 40px;
margin-top: 0;
position: absolute;
top: 0;
right: 0;
float: right;
}
.icon-login {
display: inline-block;
line-height: 40px;
height: 40px;
width: 40px;
float: right;
padding: 0;
margin: 0 0 0 20px;
}
How it's supposed to look (the green is the beginning of the icon) 外观如何(绿色是图标的开头)
IE9 IE9
Any ideas? 有任何想法吗?
Looks like a float
issue. 看起来像个float
问题。
Try wrapping the Login
text inside a div
and float
that to the left
. 尝试将Login
文本包装在div
并将其float
到left
。
I think you can use someling like below. 我认为您可以像下面那样使用水果。
<a href="#" role="button" data-toggle="modal" class="login">
Login
</a>
.login {
line-height: 40px;
height: 40px;
margin-top: 0;
position: absolute;
top: 0;
right: 0;
float: right;
background: url(icon-login.png) right center;
padding-right:40px;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.