gpt4 book ai didi

html - Bootstrap 封面图片不会在移动设备上调整大小

转载 作者:太空宇宙 更新时间:2023-11-04 02:28:04 25 4
gpt4 key购买 nike

我有以下封面图片,在桌面上看起来很棒。头像在右边,所以当我在移动设备上查看页面时,头像被截断了。

我如何制作它以便在移动设备上调整图像大小?

这是我的 Boot : http://www.bootply.com/KVei4t3ABg

这是我的 html:

<div class="intro-header">
<div class="container">

<div class="row">
<div class="col-lg-7">
<div class="intro-message">
<h1>Title</h1><br>
<p class="subtitle">Search the most comprehensive online library </p>
<p class="intro-divider"></p>
<a href="https://www.apple.com" class="btn btn-primary btn-lg">
Register for a Free Account
</a>
</div>
</div>
</div>

</div>
<!-- /.container -->
</div>

这是我的CSS:

.intro-header {
padding-top: 50px; /* If you're making other pages, make sure there is 50px of padding to make sure the navbar doesn't overlap content! */
padding-bottom: 50px;
text-align: left;
color: #f8f8f8;
background: url(http://www.onvia.com/exchange/img/background_test.jpg) no-repeat center center;
background-size: cover;
}

最佳答案

您的背景图像很宽,但相关部分很窄。我会考虑去除灰色背景,将其替换为 CSS 颜色,并始终将您的肖像设置在右边缘。考虑到切掉的肩膀,无论如何这可能是个好主意。

.intro-header {
padding-top: 50px;
padding-bottom: 50px;
text-align: left;
color: #f8f8f8;
background: url( ... ) no-repeat right center;
background-size: contain;
background-color: #ddd;
}

Demo

关于html - Bootstrap 封面图片不会在移动设备上调整大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37014277/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com