嗨,我正在尝试缩小在特定 div 中设置的背景图像,以缩小 iPhone 或 android 等移动屏幕,但它没有缩小,而是只显示大图像的特定部分,而我希望整个图像减小大小和可读性
这是在线链接,您可以在其中验证和查看样式
http://houseofskills.pk/house-of-skills/website/index
<section id="intro">
<div class="black-overlay"></div>
<div class="container valign">
<div class="row">
<div class="col-md-12">
</div>
<div class="col-md-12 text-center">
</div>
<div style="font-weight: bold; color:black;" class="col-md-6 col-md-offset-3 text-center">
</div>
</div>
</div>
</section>
<style>
.valign{
position: relative;
top: 50%;
-webkit-transform: translateY(-50%);
-ms-transform: translateY(-50%);
transform: translateY(-50%);
}
.container {
position: relative;
}
</style>
我也使用 backstrech 来设置背景图像
<script>
$("#intro").backstretch("<?php echo base_url('assets/img/banner.jpg');?>");
</script>