将屏幕上的div调整从1200px(及更高)更改为移动设备

马迪

我正在尝试创建以下布局(下面包括草图,演示链接)

对于屏幕992、1200及更高版本不能移动

对于移动设备,我希望显示屏更改以下方式 移动

我创建了一个Codeply链接,其中包含适用于屏幕尺寸992及更高屏幕的项目。但是我一直在尝试获取移动视图,但一直未能做到。

我需要为不同的屏幕尺寸制作不同的CSS吗?是否可以仅使用引导程序而不使用任何其他CSS?

有没有比这更好的方法了?

谢谢您的帮助 !!

马克西·奎

因此,这里您order在图像容器上的代码应用类。

然后我还将row添加到您的类中,如下所示:

<div class="row col-4 col-md-12 col-lg-12 d-flex justify-content-between mx-0" style="background: pink">
     <!--Apply new class as: order-3 order-sm-1 col-12, modify col-sm-12 for col-md-12 -->
     <div class="order-3 order-sm-1 col-12 col-md-2 d-flex justify-content-center flex-column align-items-center text-center" style="background: red">

演示:

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">

<div class="container-fluid">
    <div class="row w-75 mx-auto">
        <div class="row col-4 col-md-12 col-lg-12 d-flex justify-content-between mx-0" style="background: pink">
            <div class="order-3 order-md-1 col-12 col-md-2 d-flex justify-content-center flex-column align-items-center text-center" style="background: red">
                    <img src="https://icon-library.com/images/copy-link-icon/copy-link-icon-3.jpg" width="32" height="32" />
                    This is a icon
            </div>
            <div class="order-1 order-md-2 col-12 col-md-2 d-flex justify-content-center flex-column align-items-center text-center" style="background: orange">
                    <img src="https://icon-library.com/images/copy-link-icon/copy-link-icon-3.jpg" width="32" height="32" />
                    This is a icon
            </div>
            <div class="order-4 order-md-3 col-12 col-md-2 d-flex justify-content-center flex-column align-items-center text-center" style="background: green">
                    <img src="https://icon-library.com/images/copy-link-icon/copy-link-icon-3.jpg" width="32" height="32" />
                    This is a icon
            </div>
            <div class="order-2 order-md-4 col-12 col-md-2 d-flex justify-content-center flex-column align-items-center text-center" style="background: silver">
                    <img src="https://icon-library.com/images/copy-link-icon/copy-link-icon-3.jpg" width="32" height="32" />
                    This is a icon
            </div>            
        </div>
        <div class="row offset-4 col-4 offset-md-0 col-md-12 col-lg-12 d-flex justify-content-between" style="background: yellow">
            <div class="order-2 order-md-1 col-md-2 d-flex justify-content-center flex-column align-items-center text-center" style="background: blue">
                    <img src="https://icon-library.com/images/copy-link-icon/copy-link-icon-3.jpg" width="32" height="32" />
                    This is a icon
            </div>
            <div class="order-4 order-md-2 col-12 col-md-2 d-flex justify-content-center flex-column align-items-center text-center" style="background: lime">
                    <img src="https://icon-library.com/images/copy-link-icon/copy-link-icon-3.jpg" width="32" height="32" />
                    This is a icon
            </div>
            <div class="order-1 order-md-3 col-12 col-md-2 d-flex justify-content-center flex-column align-items-center text-center" style="background: lavender">
                    <img src="https://icon-library.com/images/copy-link-icon/copy-link-icon-3.jpg" width="32" height="32" />
                    This is a icon
            </div>
            <div class="order-3 order-md-4 col-12 col-md-2 d-flex justify-content-center flex-column align-items-center text-center" style="background: gold">
                    <img src="https://icon-library.com/images/copy-link-icon/copy-link-icon-3.jpg" width="32" height="32" />
                    This is a icon
            </div>                
        </div>
    </div>
</div>

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

将网站更改为m。在移动设备上

将Bootstrap布局从嵌入式表单更改为移动设备上的网格

如何在全角图像元素上方居中1200px div

在屏幕调整大小时将布局从行更改为网格

对于移动设备,将 target="_blank" 更改为 target = "_self"

将:hover更改为触摸/单击移动设备

我希望左浮动div调整移动设备上的宽度

CSS将px更改为%

无法删除 CSS 属性:Max-width:1200px

将Google自定义搜索的布局从移动设备更改为桌面设备?

将架构名称更改为更高的环境

在移动设备上如何更改两个div的顺序?

调整屏幕大小时将一行更改为两行

将中心 div 推送到移动设备上的内容顶部

调整屏幕大小时,div移动

语义UI(响应):通过在移动设备上更改为水平响应式垂直菜单

CSS / Bootstrap-网站上的侧边栏更改为移动设备上的导航栏

将元素宽度从px更改为%

在移动设备中时,将Bootstrap 3导航栏从透明更改为不透明

Selenium:“WebDriver”对象没有“Chrome”属性(将桌面更改为移动设备)

在移动设备上隐藏 DIV

将Chrome屏幕尺寸更改为移动尺寸时的纯CSS网格问题

如何在大屏幕图像下将figcaption的位置更改为移动图像中的右侧?

文字从桌面屏幕更改为移动屏幕的位置

在移动设备调整大小时将div中的项目锁定在适当的位置

在低于特定屏幕分辨率的移动设备上隐藏 div

如何设置内部<div>的样式和结构,以在移动设备上保持父<div>大小,而无需使用px作为尺寸

尝试将这些徽标以html居中,但在小于500的屏幕(即移动设备)上显示时

将下拉菜单更改为<div>,反之亦然,使用jQuery调整大小?