Materialize——扁平化卡片式网页模板

Materialize

官网:http://www.materialscss.com/

下载

http://pan.baidu.com/s/1kUUX2Vt

CSS

颜色

背景色

<div class="card-panel teal lighten-2">This is a card panel with a teal lighten-2 class</div>

文本颜色

 <div class="card-panel">
<span class="blue-text text-darken-2">This is a card panel with dark blue text</span>

</div>

调色表 http://www.materialscss.com/color

网格

Container

因为它能让你的网页内容居中。 container 的宽度大约是窗口宽度的70%,它能包裹并且居中所包裹的内容。
将网页内容放在一个包含container class的<div>标签中,例:

<body>
    <div class="container">
      <!-- Page Content goes here -->
    </div>
  </body>

12列

<div class="row">
      <div class="col s1">1</div>
      <div class="col s1">2</div>
      <div class="col s1">3</div>
      <div class="col s1">4</div>
      <div class="col s1">5</div>
      <div class="col s1">6</div>
      <div class="col s1">7</div>
      <div class="col s1">8</div>
      <div class="col s1">9</div>
      <div class="col s1">10</div>
      <div class="col s1">11</div>
      <div class="col s1">12</div>
    </div>

偏移

添加 offset-s2 class就可以达到偏移的目的, s 意味着屏幕尺寸 (s = small, m = medium, l = large),数字代表你想应用的偏移量。

<div class="row">
    <div class="col s12 grid-example"><span class="flow-text">This div is 12-columns wide on all screen sizes</span></div>
    <div class="col s6 offset-s6 grid-example"><span class="flow-text">6-columns (offset-by-6)</span></div>
  </div>

响应式布局

表格 手机 平板 电脑
前缀 .s .m .l
列数 85% 85% 70%
宽度 12 12 12
<!-- Navbar goes here -->

<!-- Page Layout here -->
<div class="row">

  <div class="col s12 m4 l3"> <!-- Note that "m4 l3" was added -->
  <!-- Grey navigation panel

  This content will be:
  3-columns-wide on large screens,
  4-columns-wide on medium screens,
  12-columns-wide on small screens  -->

  </div>

  <div class="col s12 m8 l9"> <!-- Note that "m8 l9" was added -->
  <!-- Teal page content

  This content will be:
  9-columns-wide on large screens,
  8-columns-wide on medium screens,
  12-columns-wide on small screens  -->

  </div>

</div>

图片

响应式图片

为了响应式地处理图片大小,添加 responsive-img 到img标签中就可以。原理是它定义了 max-width: 100% 和 height:auto两个属性。

<img class="responsive-img" src="cool_pic.jpg">

圆形图片

使用 class="circle"

  <div class="col s12 m8 offset-m2 l6 offset-l3">
<div class="card-panel grey lighten-5 z-depth-1">
  <div class="row valign-wrapper">
    <div class="col s2">
      <img src="images/yuna.jpg" alt="" class="circle responsive-img"> <!-- notice the "circle" class -->
    </div>
    <div class="col s10">
      <span class="black-text">
        This is a square image. Add the "circle" class to it to make it appear circular.
      </span>
    </div>
  </div>
</div>

</div>

视频

响应式内嵌

<div class="video-container">
    <iframe width="853" height="480" src="//www.youtube.com/embed/Q8TXgCzxEnw?rel=0" frameborder="0" allowfullscreen></iframe>
  </div>

响应式视频

 <video class="responsive-video" controls>
    <source src="movie.mp4" type="video/mp4">
  </video>

排版

引用:<blockquote>这是一个用了blockquote的</blockquote>
弹性文本:<p class="flow-text">I am Flow Text</p>
阴影:.z-depth-2
垂直对齐:.valign-wrapper
左对齐:.left-align
右对齐:.right-align
居中对齐:.center-align

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 136,280评论 19 139
  • 问答题47 /72 常见浏览器兼容性问题与解决方案? 参考答案 (1)浏览器兼容问题一:不同浏览器的标签默认的外补...
    _Yfling阅读 14,713评论 1 92
  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 177,218评论 25 709
  • 你总在我身旁,从冬日初升到繁星闪闪。 白天,说东说西,蹦来跳去,小吵小闹,没一刻着闲。 夜晚,翻来覆去,鼾声细细,...
    谦玙阅读 2,555评论 0 0
  • 如果不能欣喜地接受一个人的好意,是因为不确定那到底是好意还是看起来是好意。同时,委婉拒绝无果,又无法直接拒绝,...
    木兰溪阅读 5,211评论 4 1

友情链接更多精彩内容