dswsl2016 2017-09-25 00:54
浏览 123

bootstrap 4网格行和php @foreach

I am trying to switch over a site to Bootstrap 4 from Bootstrap3 and having an issue with the Grid "row" option when nesting with looping through a PHP Laravel @foreach loop.

The code that I have tried in different ways looks like:

<div class="row">
<div class="col-12">
    <div class="row">
        @foreach($sofas as $sofa)

        @if(isset($sofa['Sub']))

        <a href="{{ Request::url() }}/{{ $sofa['Style'] }}">
            <div class="col-12 col-sm-4 col-md-3" style="padding:0 5px 0 5px;">
                <div class="product_tile">
                    <div class="product_tile_style">{{ $sofa['StyleName'] }}</div>
                    <div class="product_tile_frame">Frame {{ $sofa['Style'] }}</div>

                    <div class="product_tile_thumb">
                        <img width="200" height="140" src="/imagelib/bigthumbs/{{ $sofa['url'] }} " alt="">
                    </div>
                </div>
            </div>
        </a>

        @endif
        @endforeach
    </div>
</div>

The expected outcome should look like the following: Example of what it should look like.

And this is the random mess that I am getting where it is shrinking everything and not expanding to the columns. Example of what I am getting which is wrong.

Any ideas and help would be greatly appreciated.

Thank you all in advance!

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥100 set_link_state
    • ¥15 虚幻5 UE美术毛发渲染
    • ¥15 CVRP 图论 物流运输优化
    • ¥15 Tableau online 嵌入ppt失败
    • ¥100 支付宝网页转账系统不识别账号
    • ¥15 基于单片机的靶位控制系统
    • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
    • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
    • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
    • ¥15 手机接入宽带网线,如何释放宽带全部速度