layui的案例也太怪了~~~~~

提问 已结
8 797
微秀
微秀 2017-11-21
悬赏:20飞吻
版本:layui 2 浏览器:
今天想使用案例,
无论是下载的,还是官网示例里复制的代码,弄到我心烦,
如图啊,js,css路径都正确,结果却是这个样子,揪心,浪费了一晚时间,
就是栅格布局那个,请教???怎么回事????,为什么是这样的???

回帖
  • 你好好看看这句话
    注意:下述演示中的颜色只是做一个区分作用,并非栅格内置。
    0 回复
  • @微秀 这个本来就没有颜色的啊,第一行不是有说明嘛?这个样子不就是和官方的差不多嘛?
    1 回复
  • @微秀 官方的不是告诉你了嘛,本身颜色就不是栅格自带的东西,带上颜色就是给你区分看着清楚啊,样式也是加上去的。都是演示效果用的,你能看到栅格的动态效果就是没问题啦
    1 回复
  • 微秀
    2017-11-21
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../src/css/layui.css">
    <!-- 注意:如果你直接复制所有代码到本地,上述css路径需要改成你本地的 -->
    </head>
    <body>
    <!-- 让IE8/9支持媒体查询,从而兼容栅格 -->
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

    <div class="layui-container">
    <blockquote class="layui-elem-quote">注意:下述演示中的颜色只是做一个区分作用,并非栅格内置。</blockquote>

    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>始终等比例水平排列</legend>
    </fieldset>

    <div class="layui-row">
    <div class="layui-col-xs6">
    <div class="grid-demo grid-demo-bg1">6/12</div>
    </div>
    <div class="layui-col-xs6">
    <div class="grid-demo">6/12</div>
    </div>
    </div>
    <div class="layui-row">
    <div class="layui-col-xs3">
    <div class="grid-demo grid-demo-bg1">3/12</div>
    </div>
    <div class="layui-col-xs3">
    <div class="grid-demo">3/12</div>
    </div>
    <div class="layui-col-xs3">
    <div class="grid-demo grid-demo-bg1">3/12</div>
    </div>
    <div class="layui-col-xs3">
    <div class="grid-demo">3/12</div>
    </div>
    </div>

    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>移动设备、桌面端的组合响应式展现</legend>
    </fieldset>

    <div class="layui-row">
    <div class="layui-col-xs12 layui-col-md8">
    <div class="grid-demo grid-demo-bg1">移动:12/12、桌面:8/12</div>
    </div>
    <div class="layui-col-xs6 layui-col-md4">
    <div class="grid-demo">移动:6/12、桌面:4/12</div>
    </div>
    <div class="layui-col-xs6 layui-col-md12">
    <div class="grid-demo grid-demo-bg2">移动:6/12、桌面:12/12</div>
    </div>
    </div>

    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;">
    <legend>移动设备、平板、桌面端的复杂组合响应式展现</legend>
    </fieldset>

    <div class="layui-row">
    <div class="layui-col-xs6 layui-col-sm6 layui-col-md4">
    <div class="grid-demo grid-demo-bg1">移动:6/12 | 平板:6/12 | 桌面:4/12</div>
    </div>
    <div class="layui-col-xs6 layui-col-sm6 layui-col-md4">
    <div class="grid-demo layui-bg-red">移动:6/12 | 平板:6/12 | 桌面:4/12</div>
    </div>
    <div class="layui-col-xs4 layui-col-sm12 layui-col-md4">
    <div class="grid-demo layui-bg-blue">移动:4/12 | 平板:12/12 | 桌面:4/12</div>
    </div>
    <div class="layui-col-xs4 layui-col-sm7 layui-col-md8">
    <div class="grid-demo layui-bg-green">移动:4/12 | 平板:7/12 | 桌面:8/12</div>
    </div>
    <div class="layui-col-xs4 layui-col-sm5 layui-col-md4">
    <div class="grid-demo layui-bg-black">移动:4/12 | 平板:5/12 | 桌面:4/12</div>
    </div>
    </div>

    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;">
    <legend>常规布局:从小屏幕堆叠到桌面水平排列</legend>
    </fieldset>

    <div class="layui-row">
    <div class="layui-col-md1">
    <div class="grid-demo grid-demo-bg1">1/12</div>
    </div>
    <div class="layui-col-md1">
    <div class="grid-demo">1/12</div>
    </div>
    <div class="layui-col-md1">
    <div class="grid-demo grid-demo-bg1">1/12</div>
    </div>
    <div class="layui-col-md1">
    <div class="grid-demo">1/12</div>
    </div>
    <div class="layui-col-md1">
    <div class="grid-demo grid-demo-bg1">1/12</div>
    </div>
    <div class="layui-col-md1">
    <div class="grid-demo">1/12</div>
    </div>
    <div class="layui-col-md1">
    <div class="grid-demo grid-demo-bg1">1/12</div>
    </div>
    <div class="layui-col-md1">
    <div class="grid-demo">1/12</div>
    </div>
    <div class="layui-col-md1">
    <div class="grid-demo grid-demo-bg1">1/12</div>
    </div>
    <div class="layui-col-md1">
    <div class="grid-demo">1/12</div>
    </div>
    <div class="layui-col-md1">
    <div class="grid-demo grid-demo-bg1">1/12</div>
    </div>
    <div class="layui-col-md1">
    <div class="grid-demo">1/12</div>
    </div>
    </div>

    <div class="layui-row">
    <div class="layui-col-md9">
    <div class="grid-demo grid-demo-bg1">75%</div>
    </div>
    <div class="layui-col-md3">
    <div class="grid-demo">25%</div>
    </div>
    </div>

    <div class="layui-row">
    <div class="layui-col-md4">
    <div class="grid-demo grid-demo-bg1">33.33%</div>
    </div>
    <div class="layui-col-md4">
    <div class="grid-demo">33.33%</div>
    </div>
    <div class="layui-col-md4">
    <div class="grid-demo grid-demo-bg1">33.33%</div>
    </div>
    </div>

    <div class="layui-row">
    <div class="layui-col-md6">
    <div class="grid-demo grid-demo-bg1">50%</div>
    </div>
    <div class="layui-col-md6">
    <div class="grid-demo">50%</div>
    </div>
    </div>

    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;">
    <legend>列间隔</legend>
    </fieldset>

    <div class="layui-row layui-col-space1">
    <div class="layui-col-md3">
    <div class="grid-demo grid-demo-bg1">1/4</div>
    </div>
    <div class="layui-col-md3">
    <div class="grid-demo">1/4</div>
    </div>
    <div class="layui-col-md3">
    <div class="grid-demo grid-demo-bg1">1/4</div>
    </div>
    <div class="layui-col-md3">
    <div class="grid-demo">1/4</div>
    </div>
    </div>

    <div class="layui-row layui-col-space5">
    <div class="layui-col-md4">
    <div class="grid-demo grid-demo-bg1">1/3</div>
    </div>
    <div class="layui-col-md4">
    <div class="grid-demo">1/3</div>
    </div>
    <div class="layui-col-md4">
    <div class="grid-demo grid-demo-bg1">1/3</div>
    </div>
    </div>

    <div class="layui-row layui-col-space10">
    <div class="layui-col-md9">
    <div class="grid-demo grid-demo-bg1">9/12</div>
    </div>
    <div class="layui-col-md3">
    <div class="grid-demo">3/12</div>
    </div>
    </div>

    <div class="layui-row layui-col-space15">
    <div class="layui-col-md7">
    <div class="grid-demo grid-demo-bg1">7/12</div>
    </div>
    <div class="layui-col-md5">
    <div class="grid-demo">5/12</div>
    </div>
    </div>

    <div class="layui-row layui-col-space30">
    <div class="layui-col-md7">
    <div class="grid-demo grid-demo-bg1">7/12</div>
    </div>
    <div class="layui-col-md5">
    <div class="grid-demo">5/12</div>
    </div>
    </div>

    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;">
    <legend>列偏移</legend>
    </fieldset>

    <div class="layui-row">
    <div class="layui-col-md4">
    <div class="grid-demo grid-demo-bg1">4/12</div>
    </div>
    <div class="layui-col-md4 layui-col-md-offset4">
    <div class="grid-demo">偏移4列</div>
    </div>
    <div class="layui-col-md1 layui-col-md-offset5">
    <div class="grid-demo grid-demo-bg1">偏移5列</div>
    </div>
    <div class="layui-col-md1">
    <div class="grid-demo">不偏移</div>
    </div>
    </div>

    <div class="layui-row">
    <div class="layui-col-md3 layui-col-md-offset3">
    <div class="grid-demo grid-demo-bg1">偏移3列</div>
    </div>
    <div class="layui-col-md3 layui-col-md-offset1">
    <div class="grid-demo">偏移1列</div>
    </div>
    </div>

    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;">
    <legend>栅格嵌套</legend>
    </fieldset>

    <div class="layui-row">
    <div class="layui-col-md5">
    <div class="layui-row grid-demo">
    <div class="layui-col-md3">
    <div class="grid-demo grid-demo-bg1">内部列</div>
    </div>
    <div class="layui-col-md9">
    <div class="grid-demo grid-demo-bg2">内部列</div>
    </div>
    <div class="layui-col-md12">
    <div class="grid-demo grid-demo-bg3">内部列</div>
    </div>
    </div>
    </div>
    <div class="layui-col-md7">
    <div class="layui-row grid-demo grid-demo-bg1">
    <div class="layui-col-md12">
    <div class="grid-demo">内部列</div>
    </div>
    <div class="layui-col-md9">
    <div class="grid-demo grid-demo-bg2">内部列</div>
    </div>
    <div class="layui-col-md3">
    <div class="grid-demo grid-demo-bg3">内部列</div>
    </div>
    </div>
    </div>
    </div>

    </div>

    <div class="layui-fluid">
    <fieldset class="layui-elem-field layui-field-title">
    <legend>流体容器(宽度自适应,不固定)</legend>
    </fieldset>
    <div class="layui-row">
    <div class="layui-col-sm3">
    <div class="grid-demo grid-demo-bg1">25%</div>
    </div>
    <div class="layui-col-sm3">
    <div class="grid-demo">25%</div>
    </div>
    <div class="layui-col-sm3">
    <div class="grid-demo grid-demo-bg1">25%</div>
    </div>
    <div class="layui-col-sm3">
    <div class="grid-demo">25%</div>
    </div>
    </div>
    </div>


    <script src="../src/layui.js"></script>
    <!-- 注意:如果你直接复制所有代码到本地,上述js路径需要改成你本地的 -->
    <script>

    </script>

    </body>
    </html>
    0 回复
  • Jo
    2017-11-21
    应该是只引入了layui,没引入这个页面的单独的样式,看下控制台有没有404
    0 回复
  • 微秀
    2017-11-21
    @Jo @冬日温暖

    css,js路径没错啊
    为什么这么难看的呢??
    你看官方的
    0 回复
  • 微秀
    2017-11-21
    @冬日温暖

    谢谢,了解了
    0 回复
  • 孤胆英雄
    2017-11-21
    @微秀 太逗了,文章都没看全,就来喷。哎
    0 回复
本帖已设置禁止回复