【发布时间】:2019-08-06 02:19:39
【问题描述】:
我有图像居中(和分层)屏幕的死点,以及图像下方的粘性导航。它在 Chrome 中可以完美运行,但在 IE 或 Firefox 中则不行。
我错过了什么?
这是 HTML
<div class="row">
<div class="eventWrapper">
<div class="col-md-6">
<div class="hero">
<img src="http://via.placeholder.com/300/00f" class="eventHeroImg imgFire">
<img src="http://via.placeholder.com/200/fff" class="eventHeroImg imgLight">
<img src="http://via.placeholder.com/100/f00" class="eventHeroImg imgChange">
</div><!--/hero-->
</div><!--/col-6-->
<div class="col-md-6">
<div class="hero">
<div class="solgan-column">
<img src="http://via.placeholder.com/300/f00" class="eventHeroImgimgFire">
<img src="http://via.placeholder.com/200/fff" class="eventHeroImg imgLight">
<img src="http://via.placeholder.com/100/00f" class="eventHeroImg imgChange">
</div><!--/slogan-column-->
</div><!--/hero-->
</div><!--/col-6-->
</div><!--/wrapper-->
</div><!--/row-->
<!--
<div class="row">
<div class="col-md-12">
<div class="fullwidth_header_scroll">
<a href="#nav">
<i class="fas fa-angle-double-down fa-3x centerArrowBottom wow fadeIn" data-wow-delay="1.5s" data-wow-duration="2s"></i>
</a>
</div><!--/fullwidth-->
</div><!--/12-->
</div><!--/row-->
<ul id="nav">
<li><a class="active" href="#top">Top</a></li>
<li><a href="#about">About</a></li>
<li><a href="#sponsorship">something</a></li>
</ul>
<script src="https://wowjs.uk/dist/wow.min.js"></script>
<script>
new WOW().init();
</script>
这是CSS
html {scroll-behavior: smooth}
body {
font-size: 16px; margin: 0;
}
ul#nav {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #333;
position: -ms-sticky;
position: -webkit-sticky; /* Safari */
position: sticky;
top: 0;
}
ul#nav li {
float: left;
}
ul#nav li a {
display: block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
ul#nav li a:hover {
background-color: #111;
}
.active {
background-color: #000066;
}
.hero {
height: -webkit-fill-available;
}
img.eventHeroImg, .solgan-column {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
-webkit-transform: translate(-50%, -50%);
}
.imgLight {
z-index: 3;
}
.imgChange {
z-index: 5;
}
.imgFire {
z-index: 1;
}
.centerArrowBottom {margin: auto !important;
color: white;
vertical-align: baseline;}
.fullwidth_header_scroll {
position: absolute;
z-index: 3;
right: 0;
bottom: 0;
left: 0;
width: 100%;
min-height: 30px;
margin: 0 auto;
padding-top: 10px;
padding-bottom: 20px;
text-align: center;
}
a.fullwidth_header_scroll {scroll-behavior: smooth;}
.centerArrowBottom:hover {
color: darken(#00f, 10%)
}
.eventWrapper {background-image: url("http://eskipaper.com/images/beach-background-4.jpg");
background-size: 100%;
height: -webkit-fill-available;}
.slogan {color: goldenrod; font-weight: bold; text-align: center; font-family: 'Oswald'; font-size: 150%; font-weight: bold; }
.slogan-left {float: left}
.slogan-right {float: right}
.heroEventInfo {font-family: 'Raleway'; font-size: 125%}
【问题讨论】:
标签: css twitter-bootstrap css-position css-transforms