我不明白爲什麼Safari會在本網站上的圖像底部添加一個空白區域。Safari在我的圖像下顯示空白區域?
它在Firefox和Chrome中正確渲染。圖像應該固定在頁面的底部,包括調整大小時。
下面是一些HTML
<!-- Page Content -->
<div class="container-fluid">
<div class="span12">
<div id="headImage">
<img class="center fit" src="images/Dale2.png" onmousedown='return false;' ondragstart='return false;'>
</div>
</div>
<!-- ./container -->
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript" language="JavaScript">
function set_body_height() { // set body height = window height
$('body').height($(window).height());
}
$(document).ready(function() {
$(window).bind('resize', set_body_height);
set_body_height();
});
$('img').bind('contextmenu', function (e) {
return false;
});
$(document).ready(function() {
$(".center").hover(function() {
$(this).attr("src", "images/DaleBlurWithText.png");
}, function() {
$(this).attr("src", "images/Dale2.png");
});
});
</script>
</body>
和CSS
body {
max-height:100%;
min-height: 100%;
background-color: white;
padding-top: 50px;
overflow: hidden;
-webkit-overflow-scrolling: touch;
}
.navbar {
background: white;
border: none;
}
.navbar-brand nav navbar-nav {
text-align: center;
}
.navbar .navbar-nav {
display: inline-block;
float: none;
vertical-align: top;
margin: 0;
}
.navbar navbar-collapse {
text-align: center;
}
* {
padding: 0;
margin: 0;
}
.fit {
/* set relative picture size */
max-width: 100%;
max-height: 100%;
}
.center {
display: block;
margin: auto;
bottom-fixed: 0;
vertical-align: bottom;
}
請提供減少的測試用例。有關更多信息,請參閱https://css-tricks.com/reduced-test-cases/。 –
只是好奇......這是什麼? 'bottom-fixed:0;' –
@Paulie_D將圖像固定到底部,但我認爲如果你問它是什麼,它不會這樣做haha – FrasKyl