简体   繁体   English

Bootstrap 图像不显示在较小的屏幕上

[英]Bootstrap image not displaying on smaller screens

I have an image that gets displayed properly on desktop view, but becomes 0x0 when browsing from mobile.我有一张图片可以在桌面视图上正确显示,但在从移动设备浏览时变为 0x0。 I can't seem to crack the cause of this one.我似乎无法破解这个原因。 The site is running Bootstrap 4 and the issue can be seen here: https://clonegram.ritvars.lv/profile/demouser该站点正在运行 Bootstrap 4,问题可以在这里看到: https : //clonegram.ritvars.lv/profile/demouser

Mobile view移动视图
移动视图

Desktop view桌面视图
桌面视图

Code代码

<div class="row">
    <div class="col-3 p-5">
        <img src="{{ $user->profile->profileImage() }}" class="rounded-circle w-100">
    </div>
    <div class="col-9 pt-5">
        <div class="d-flex align-items-center">
            <h1 class="mr-4">{{ $user->username }}</h1>
            ...
        </div>
        ...
    </div>
</div>

That's because of padding: 3rem !important .那是因为padding: 3rem !important

You can improve it by having, some min-height or min-width and setting your padding just for larger viewport screens.您可以通过设置一些min-heightmin-width并仅为较大的视口屏幕设置填充来改进它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM