【发布时间】:2013-08-05 02:15:20
【问题描述】:
我对 HTML 和 CSS 有疑问。所以我的列表有一个 CSS 样式,但在 IE 中它不起作用。
这是我的 HTML 文件:
<ul class="main-ul2">
<li><a href="#"><span>Home</span></a></li>
<li><a href="#"><span>Article</span></a></li>
<li><a href="#"><span>Blog</span></a></li>
<li><a href="#"><span>Gallery</span></a></li>
</ul>
这是我的 CSS 文件:
.main-ul2 li {
margin-left: 0;
float:left;
position:relative;
width:25%;
text-align:center;
}
.main-ul2 li a {
display:block;
padding-bottom: 20px;
padding-right:10px;
padding-top: 10px;
padding-left:10px;
text-decoration:none;
position: relative;
z-index: 100;
background-color: rgba(164, 164, 164, 0.2);
–ms-??transition: all 1s;
-webkit-transition: all 1s;
-moz-transition: all 1s;
-o-transition: all 1s;
transition: all 1s;
}
.main-ul2 li a span{
display:block;
padding-top:10px;
font-weight:700;
font-size: 20px;
color: rgba(120, 120, 120, 0.9);
text-transform:uppercase;
font-family: 'Kotta One', serif;
.main-ul2 li:hover span{
color: #fff;
}
.main-ul2 li:nth-child(1):hover a{
background-color: rgba(175,54,55,0.8);
–ms-transform:rotate(-3deg);
-moz-transform: rotate(-3deg);
-webkit-transform: rotate(-3deg);
-o-transform: rotate(-3deg);
transform: rotate(-3deg);
}
.main-ul2 li:nth-child(2):hover a{
background-color: rgba(199, 204, 73, 0.8);
–ms-transform:rotate(-3deg);
-moz-transform: rotate(-3deg);
-webkit-transform: rotate(-3deg);
-o-transform: rotate(-3deg);
transform: rotate(-3deg);
}
.main-ul2 li:nth-child(3):hover a{
background-color: rgba(213, 135, 11, 0.8);
–ms-transform:rotate(3deg);
-moz-transform: rotate(3deg);
-webkit-transform: rotate(3deg);
-o-transform: rotate(3deg);
transform: rotate(3deg);
}
.main-ul2 li:nth-child(4):hover a{
background-color: rgba(51, 143, 144, 0.8);
–ms-transform:rotate(3deg);
-moz-transform: rotate(3deg);
-webkit-transform: rotate(3deg);
-o-transform: rotate(3deg);
transform: rotate(3deg);
}
因此,如果您使用的是 Google Chrome,您可以将我的代码插入 CCS Desk 或任何其他在线 CSS 编辑器,一切正常(子弹会改变颜色并移动),但是如果您在 IE 中打开我的代码,您会发现它无法正常工作。
我在Google中搜索过,发现需要添加Microsoft transform。
那么有人可以告诉我如何添加 Microsoft 转换,或者是否有任何其他方法可以解决此问题?
谢谢。
【问题讨论】:
-
根据developer.mozilla.org/en-US/docs/Web/CSS/transition,IE 10支持
transition,所以你不需要–ms-??transition -
@MikeVayvala 也许这篇文章的标题应该更具体一些。因为我可以通过研究 IE 的网络一致性问题来谋生。
-
我们能有小提琴吗?
标签: html css list internet-explorer google-chrome