再会
我正在设置opacity
2 个元素,一个li
元素和一个image
元素。在hover
效果上,我消除了不透明度。
问题:我正在使用媒体查询在手机上显示我的网站。问题是,当我为 设置媒体查询时1024px
,我想opacities
完全删除它,但是当视口低于 1024px 时它不会触发 ...刷新
这是为什么:
代码:
HTML:
<div id="app" class="span3">
<ul>
<li id="apple"><a href="#" title="PartyAt for iPhone and iPad"><img src="images/apple.png" /></a></li>
<li id="android"><a href="#"><img alt="PartyAt Android app on Google Play" src="images/android.png" /></a></li>
</ul>
</div>
and
<div id="social" class="row-fluid">
<div class="span7">
<div id="app2">
<a href="https://itunes.apple.com/za/app/partyat/id597807299?mt=8" title="PartyAt for iPhone and iPad"><img src="images/apple.png" /></a>
<a href="https://play.google.com/store/apps/details?id=io.ik.partyat"><img alt="PartyAt Android app on Google Play" src="images/android.png" /></a>
</div>
</div>
<div class="span5">
<a href="" title="PartyAt SA facebook page" target="_blank"><img src="images/fb.png" border="0" /></a>
<a href="" title="PartyAt SA twitter page" target="_blank"><img src="images/twitter.png" border="0" /></a>
</div>
</div>
CSS:
#app ul li{
opacity:0.7;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=70)";
filter:alpha(opacity=70);
padding-bottom: 15px;
}
#social .span5 img {
opacity: 0.7;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=70)";
filter:alpha(opacity=70);
}
媒体查询:
@media screen and (max-width: 1024px;){
#app ul li {
opacity:1;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
filter:alpha(opacity=100);
padding-bottom: 15px;
}
#social .span5 img {
opacity: 1;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
filter:alpha(opacity=100);
}
}