compass reset和layout [Sass和compass学习笔记]

简介: reset 可以重置浏览器的的html的默认样式,因为各个浏览器对有些元素解析差别很大 通过重置样式可以让样式的浏览器兼容 更简单 使用方法简单 @import "compass/reset" layout 有几个常见的布局函数,我觉得挺管用,其他的都是用来写组建非常常用的 Sticky Footer 该模块提供了需要布置你的页脚,它坚持到页面底部的工具。

reset 可以重置浏览器的的html的默认样式,因为各个浏览器对有些元素解析差别很大

通过重置样式可以让样式的浏览器兼容 更简单

使用方法简单

@import "compass/reset"

layout 有几个常见的布局函数,我觉得挺管用,其他的都是用来写组建非常常用的

Sticky Footer

该模块提供了需要布置你的页脚,它坚持到页面底部的工具。

这个模块主要用于布局页脚,可以让页脚固定在页面的最底部,是一个比较常用的功能,而且有配套的html代码

引用方法

@import "compass/layout/sticky-footer"
使用方法
@include sticky-footer(54px, "#my-root", "#my-root-footer", "#my-footer")
对应的html结构
<body>
  <div id="root">
    <div id="root_footer"></div>
  </div>
  <div id="footer">
    Footer content goes here.
  </div>
</body>

官方还在有在线demo http://compass-style.org/examples/compass/layout/sticky-footer/ 

具体的语法sticky-footer($footer-height, $root-selector, $root-footer-selector, $footer-selector)

$footer-height:页脚高度

$root-selector:页面主题的id

$root-footer-selector:形式上的页脚id

$footer-selector:真是页脚

Stretching

Stretching 主要用于定位 用于在父容器中定位子元素的我位置

官方也有一些 demo  http://compass-style.org/examples/compass/layout/stretching/

例如 下边这些 布局

image

 

包含的布局函数


stretch-y($offset-top, $offset-bottom)         定位在y方向的定位
stretch-x($offset-left, $offset-right)              定位在x方向的定位
stretch($offset-top, $offset-right, $offset-bottom, $offset-left) 综合x,y方向的定位

Grid Backgrounds

网格背景混合组件允许你产生固定,流体和弹性网格布局,

这是使用css3  Gradients 实现的,

主要用于布局的测试和校对 我感觉

其实我感觉这个没什么用,主要用来作为参考布局用

具体如何引用和各种使用方法可以参考这里http://compass-style.org/reference/compass/layout/grid_background/

test
相关文章
|
9天前
|
安全 Apache PHP
文件上传--Upload-labs--Pass09(在某些版本里是Pass10)--点+空格+点 绕过
文件上传--Upload-labs--Pass09(在某些版本里是Pass10)--点+空格+点 绕过
|
4月前
【Webpack】TypeError: Cannot read property ‘tap‘ of undefined at HtmlWebpackPlugin.
【Webpack】TypeError: Cannot read property ‘tap‘ of undefined at HtmlWebpackPlugin.
|
11月前
|
安全 Shell PHP
一次ThinkPHP引发的bypass_disable_functions
一次ThinkPHP引发的bypass_disable_functions
|
自然语言处理 算法 数据挖掘
浅谈Single-Pass算法
Single-Pass算法又称单通道法或单遍法,是流式数据聚类的经典方法。对于依次到达的数据流,该方法按输入顺序每次处理一个数据,依据当前数据与已有类的匹配度大小,将该数据判为已有类或者创建一个新的数据类,实现流式数据的增量和动态聚类,适合对流数据进行挖掘,而且算法的时间效率高;不足之处主要表现在该方法具有输入次序依赖特性,即对于同一聚类对象按不同的次序输入,会出现不同的聚类结果。
179 0
|
前端开发
前端 scss文件报错 Base-level rules cannot contain the parent-selector-referencing character '&'. 解决办法
前端 scss文件报错 Base-level rules cannot contain the parent-selector-referencing character '&'. 解决办法
402 0
CPS fact debug - Continuation-pass style
Created by Wang, Jerry, last modified on Dec 24, 2015
160 0
CPS fact debug - Continuation-pass style
|
Oracle 关系型数据库