【问题标题】:Using Bootstrap push and pull使用 Bootstrap 推拉
【发布时间】:2017-08-22 21:56:48
【问题描述】:

我搜索了一下,发现了这个帖子:Bootstrap Alternating Layout to stacked in mobile

但是,当我在代码中添加推拉时,即使在完整的桌面视图中也会发生推拉。

例如:

<section class="block block--2">

<div class="container">

    <div class="row padbot20">
        <div class="col-md-4 center col-sm-12 col-xs-12">
             <center>
                 <i class="fa_black_icon fa fontawesome-icon fa-address-book"></i>
             </center>
        </div>
        <div class="col-md-8 col-sm-12 col-xs-12">
            <div class="heading padbot20">
                <h3 class="black_txt">
                    {% text "section_2_row_1_heading", overrideable=True, value="Supplier Management", label="Section 2 Row 1 Heading", no_wrapper=True %}
                </h3>
            </div>
            <div class="row-paragraph">
                 {% rich_text "section_2_row_1_content", overrideable=True, value="<p>With Volo, you’ll can keep all your key supplier information up to date so you know exactly where you are. Monitor the prices you’re paying for your stock, use automated data feeds to increase productivity, or use drop-shippers to do the product storage and delivery for you – the choice is yours.</p>", label="Section 2 Row 1 Content", no_wrapper=True %}
            </div>
        </div>


    </div>

    <div class="row padtop20 padbot20">
        <div class=" col-md-8 ">
            <div class="heading padbot20">
                <h3 class="black_txt">
                    {% text "section_2_row_2_heading", overrideable=True, value="Inventory & Stock Control ", label="Section 2 Row 2 Heading", no_wrapper=True %}
                </h3>
            </div>
            <div class="row-paragraph">
                 {% rich_text "section_2_row_2_content", overrideable=True, value="<p>Control your physical and virtual inventory data across all your sales channels with Volo, from single custom items through to managing millions of SKUs and variations. We’ve made it simple: one central location for storing all the information needed for the different channels. Sell items on one channel and we’ll automatically update the rest.</p>", label="Section 2 Row 2 Content", no_wrapper=True %}
            </div>
        </div>
        <div class="col-md-4 center">
             <center>
                 <i class="fa_black_icon fa fontawesome-icon fa-cubes"></i>
             </center>
        </div>
    </div>

    <div class="row padtop20 padbot20">
        <div class="col-md-4 center col-sm-12 col-xs-12">
             <center>
                 <i class="fa_black_icon fa fontawesome-icon fa-sitemap"></i>
             </center>
        </div>
        <div class="col-md-8 col-sm-12 col-xs-12">
            <div class="heading padbot20">
                <h3 class="black_txt">
                    {% text "section_2_row_3_heading", overrideable=True, value="Multichannel Management", label="Section 2 Row 3 Heading", no_wrapper=True %}
                </h3>
            </div>
            <div class="row-paragraph">
                 {% rich_text "section_2_row_3_content", overrideable=True, value="<p>Selling successfully is about being in the right places, responding quickly and capitalizing on the opportunities. We’ll enable you to reach new markets, new audiences, and new sales targets. Volo gives you resilience across all your channels</p>", label="Section 2 Row 3 Content", no_wrapper=True %}
            </div>
        </div>
    </div>

    <div class="row padtop20 padbot20">
        <div class="col-md-8 col-sm-12 col-xs-12">
            <div class="heading padbot20">
                <h3 class="black_txt">
                    {% text "section_2_row_4_heading", overrideable=True, value="Order Management", label="Section 2 Row 4 Heading", no_wrapper=True %}
                </h3>
            </div>
            <div class="row-paragraph">
                 {% rich_text "section_2_row_4_content", overrideable=True, value="<p>At Volo, our approach is to help bring together all your sales information into a single, coherent view so you can streamline your processes. From matching orders to payments quickly, through to shipping list for packing, manifests for shipments, and invoice and delivery documentation.</p>", label="Section 2 Row 4 Content", no_wrapper=True %}
            </div>
        </div>
        <div class="col-md-4 center col-sm-12 col-xs-12">
             <center>
                 <i class="fa_black_icon fa fontawesome-icon fa-credit-card"></i>
             </center>
        </div>
    </div>
    <div class="row padtop20 padbot20">
        <div class="col-md-4 center col-sm-12 col-xs-12">
             <center>
                 <i class="fa_black_icon fa fontawesome-icon fa-truck"></i>
             </center>
        </div>
        <div class="col-md-8 col-sm-12 col-xs-12">
            <div class="heading padbot20">
                <h3 class="black_txt">
                    {% text "section_2_row_5_heading", overrideable=True, value="Shipping", label="Section 2 Row 5 Heading", no_wrapper=True %}
                </h3>
            </div>
            <div class="row-paragraph">
                 {% rich_text "section_2_row5_content", overrideable=True, value="<p>We can help you reduce time and costs by implementing a completely integrated fulfillment process. You’ll be able to connect your carriers, shipping aggregators and consolidators into one system, giving you effective and efficient control.</p>", label="Section 2 Row 5 Content", no_wrapper=True %}
            </div>
        </div>
    </div></div></section>

但是,当我添加推拉时,我在桌面版本上出现了巨大的差距,并且推拉仍然适用,尽管添加了“col-xs-push-12”和“col-xs-pull-12” " 到代码示例(和屏幕截图)-

截图: 代码:

        <section class="block block--2">

        <div class="container">

            <div class="row padbot20">
                <div class="col-md-4 center col-sm-12 col-xs-12">
                     <center>
                         <i class="fa_black_icon fa fontawesome-icon fa-address-book"></i>
                     </center>
                </div>
                <div class="col-md-8 col-sm-12 col-xs-12">
                    <div class="heading padbot20">
                        <h3 class="black_txt">
                            {% text "section_2_row_1_heading", overrideable=True, value="Supplier Management", label="Section 2 Row 1 Heading", no_wrapper=True %}
                        </h3>
                    </div>
                    <div class="row-paragraph">
                         {% rich_text "section_2_row_1_content", overrideable=True, value="<p>With Volo, you’ll can keep all your key supplier information up to date so you know exactly where you are. Monitor the prices you’re paying for your stock, use automated data feeds to increase productivity, or use drop-shippers to do the product storage and delivery for you – the choice is yours.</p>", label="Section 2 Row 1 Content", no_wrapper=True %}
                    </div>
                </div>


            </div>

            <div class="row padtop20 padbot20">
                <div class="col-md-8 col-sm-push-12 col-xs-push-12">
                    <div class="heading padbot20">
                        <h3 class="black_txt">
                            {% text "section_2_row_2_heading", overrideable=True, value="Inventory & Stock Control ", label="Section 2 Row 2 Heading", no_wrapper=True %}
                        </h3>
                    </div>
                    <div class="row-paragraph">
                         {% rich_text "section_2_row_2_content", overrideable=True, value="<p>Control your physical and virtual inventory data across all your sales channels with Volo, from single custom items through to managing millions of SKUs and variations. We’ve made it simple: one central location for storing all the information needed for the different channels. Sell items on one channel and we’ll automatically update the rest.</p>", label="Section 2 Row 2 Content", no_wrapper=True %}
                    </div>
                </div>
                <div class="col-md-4 center col-sm-pull-12 col-xs-pull-12">
                     <center>
                         <i class="fa_black_icon fa fontawesome-icon fa-cubes"></i>
                     </center>
                </div>
            </div>

            <div class="row padtop20 padbot20">
                <div class="col-md-4 center col-sm-12 col-xs-12">
                     <center>
                         <i class="fa_black_icon fa fontawesome-icon fa-sitemap"></i>
                     </center>
                </div>
                <div class="col-md-8 col-sm-12 col-xs-12">
                    <div class="heading padbot20">
                        <h3 class="black_txt">
                            {% text "section_2_row_3_heading", overrideable=True, value="Multichannel Management", label="Section 2 Row 3 Heading", no_wrapper=True %}
                        </h3>
                    </div>
                    <div class="row-paragraph">
                         {% rich_text "section_2_row_3_content", overrideable=True, value="<p>Selling successfully is about being in the right places, responding quickly and capitalizing on the opportunities. We’ll enable you to reach new markets, new audiences, and new sales targets. Volo gives you resilience across all your channels</p>", label="Section 2 Row 3 Content", no_wrapper=True %}
                    </div>
                </div>
            </div>

            <div class="row padtop20 padbot20">
                <div class="col-md-8 col-sm-12 col-xs-12">
                    <div class="heading padbot20">
                        <h3 class="black_txt">
                            {% text "section_2_row_4_heading", overrideable=True, value="Order Management", label="Section 2 Row 4 Heading", no_wrapper=True %}
                        </h3>
                    </div>
                    <div class="row-paragraph">
                         {% rich_text "section_2_row_4_content", overrideable=True, value="<p>At Volo, our approach is to help bring together all your sales information into a single, coherent view so you can streamline your processes. From matching orders to payments quickly, through to shipping list for packing, manifests for shipments, and invoice and delivery documentation.</p>", label="Section 2 Row 4 Content", no_wrapper=True %}
                    </div>
                </div>
                <div class="col-md-4 center col-sm-12 col-xs-12">
                     <center>
                         <i class="fa_black_icon fa fontawesome-icon fa-credit-card"></i>
                     </center>
                </div>
            </div>
            <div class="row padtop20 padbot20">
                <div class="col-md-4 center col-sm-12 col-xs-12">
                     <center>
                         <i class="fa_black_icon fa fontawesome-icon fa-truck"></i>
                     </center>
                </div>
                <div class="col-md-8 col-sm-12 col-xs-12">
                    <div class="heading padbot20">
                        <h3 class="black_txt">
                            {% text "section_2_row_5_heading", overrideable=True, value="Shipping", label="Section 2 Row 5 Heading", no_wrapper=True %}
                        </h3>
                    </div>
                    <div class="row-paragraph">
                         {% rich_text "section_2_row5_content", overrideable=True, value="<p>We can help you reduce time and costs by implementing a completely integrated fulfillment process. You’ll be able to connect your carriers, shipping aggregators and consolidators into one system, giving you effective and efficient control.</p>", label="Section 2 Row 5 Content", no_wrapper=True %}
                    </div>
                </div>
            </div>

            <div class="row padtop20 padbot20">
                <div class="col-md-8 col-sm-12 col-xs-12">
                    <div class="heading padbot20">
                        <h3 class="black_txt">
                            {% text "section_2_row_6_heading", overrideable=True, value="Reporting & Analytics", label="Section 2 Row 6 Heading", no_wrapper=True %}
                        </h3>
                    </div>
                    <div class="row-paragraph">
                         {% rich_text "section_2_row_6_content", overrideable=True, value="<p>Volo reporting & analytics turns your performance data into information, giving you the knowledge and confidence to make quick decisions that positively impact all the things you measure your success by: revenues, profits and cash flow.</p>", label="Section 2 Row 6 Content", no_wrapper=True %}
                    </div>
                </div>
                <div class="col-md-4 center col-sm-12 col-xs-12">
                     <center>
                         <i class="fa_black_icon fa fontawesome-icon fa-pie-chart"></i>
                     </center>
                </div>
            </div> 
        </div>

    </section>

但随后会发生这种情况: https://gyazo.com/7a39f8711b274eda998d48eae5278634

我做错了什么?

任何建议将不胜感激 - 谢谢

【问题讨论】:

    标签: html push pull hubspot


    【解决方案1】:

    你必须像下面这样维护你的代码。

    关于 -- 外观和感觉

    您的代码结构看起来像您需要单行中的 2 列

    桌面版的设计应该是col-md-4col-md-8

    并且在移动和平板设备中的设计应该类似于 col-sm-12 等被丢弃的列。

    .

    创建您的代码结构,如下所示,并确保维护代码的稳定性,如下所示。

    <section class="">
        <div class="container">
            <div class="row">
                <div class="col-md-4 col-md-push-8 col-sm-12">Icon</div>
                <div class="col-md-8 col-md-pull-4 col-sm-12">Details will be here.</div>
            </div>
            <div class="row">
                <div class="col-md-4 col-sm-12">Icon</div>
                <div class="col-md-8 col-sm-12">Details will be here.</div>
            </div>
            <div class="row">
                <div class="col-md-4 col-md-push-8 col-sm-12">Icon</div>
                <div class="col-md-8 col-md-pull-4 col-sm-12">Details will be here.</div>
            </div>
            <div class="row">
                <div class="col-md-4 col-sm-12">Icon</div>
                <div class="col-md-8 col-sm-12">Details will be here.</div>
            </div>
        </div>
    </section>
    

    希望它对您有所帮助.. 干杯:)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-05-05
      • 2017-01-15
      • 1970-01-01
      • 2018-04-25
      • 1970-01-01
      • 2019-12-11
      • 1970-01-01
      相关资源
      最近更新 更多