不好意思,我不太喜欢引导,但当我在类中包括属性w-50时,我只尝试更改名为div class=的容器的宽度“行边框-备用mx-auto",而不调整div元素的高度和内容图像的高度。图片相关的发生,我只想修剪边和基本上包装我的图像到那个div,这将有一个固定的宽度和高度。
我玩了一会儿,搜索了一下,但仍然不知道还能做什么,除了将它更改为px之外,但是当页面最小化时,它不会按比例调整大小。
<div class="row border border-secondary mx-auto">
<div class="col-6 offset-3">
<a href="/profile/{{ $post->user->id }}">
<img src="/storage/{{ $post->image }}" class="w-100">
</a>
</div>
</div>发布于 2021-08-16 19:10:14
找到的解决方案-基本上删除了cod-6偏移量-3类,并添加了一些样式到图像,你通常会使用它来适应一个图像到div。
<div class="row border border-secondary mx-auto w-50">
<div>
<a href="/profile/{{ $post->user->id }}">
<img style="
max-width: 100%;
max-height: 100%;
display: block;
height: 600px;"
src="/storage/{{ $post->image }}">
</a>
</div>
</div>https://stackoverflow.com/questions/68806715
复制相似问题