博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Compass排版模块
阅读量:7055 次
发布时间:2019-06-28

本文共 1807 字,大约阅读时间需要 6 分钟。

1. 超链接样式

1.1 导航链接

  • 为链接配色

link-colors(a, :hover, :active, :visited, :focus)混合器

index.html

main.scss

@import "compass/typography";a {    @include link-colors(        #333,        $hover: #a00,        $active: #a52,        $visited: #555,        $focus: #a52    );}
  • hover-link设置悬停样式

hover-link混合器

main.scss

@import "compass/typography";a {    @include link-colors(        #333,        $hover: #a00,        $active: #a52,        $visited: #555,        $focus: #a52    );    @include hover-link}

1.2 文本中的链接

通过unstyled-link混合器设置隐性链接

index.html

学习Compass请来Compass官网

main.scss

@import "compass/typography";p.content a {    @include unstyled-link}

2. 列表样式

2.1 pretty-bullet装点列表

pretty-bullet混合器

index.html

main.scss

@import "compass/typography";ul.features {    @include pretty-bullets('pretty-bullet.png',                    $padding: 20px,                    $line-height: 22px                )}
如图:

列表

2.2 去掉项目符号

no-bullet混合器

no-bullets混合器

index.html

main.scss

@import "compass/typography";ul.no-bullet {    @include no-bullets}

2.3 横向排列

horizontal-list混合器,有两个参数$padding $direction.例如 horizontal-list(7px, right)

main.scss

@import "compass/typography";ul.nav {    @include horizontal-list}

2.4 内联列表

delimited-list混合器 可以定制列表分隔符,比如dellimited-list("!")

index.html

  • PS切图
  • HTML
  • CSS
  • JavaScript

是Web工程师的基础必备技能。

main.scss

@import "compass/typography";ul.container {    @include delimited-list("!")}

效果如图

内联列表

3. 文字/文本处理

3.1 省略号代表截断内容

ellipsis混合器

ellipsis

3.2 nowrap防止文本折行

nowrap混合器

nowrap

3.3 replace-text将图片转换为文字

replace-text混合器 replace-text-with-dimensions混合器(根据图片的宽高设定元素尺寸)

replace-text-with-dimensions("logo.png")

转载地址:http://hglol.baihongyu.com/

你可能感兴趣的文章
Oracle 12c 新特性之 temp undo
查看>>
css中,如何设置前景色的透明度?
查看>>
SQL Server2008附加数据库之后显示为只读时解决方法
查看>>
USACO Section 2.1 Healthy Holsteins
查看>>
struts2学习笔记(8)-------struts2的ajax支持
查看>>
从0开始安装fedora23的笔记-- 以及使用fedora的常规问题-3
查看>>
sqlite学习笔记6:更新表数据-update
查看>>
Excel大写和小写转换函数
查看>>
fork failed because of Out Of Memory
查看>>
Bitmap具体解释与Bitmap的内存优化
查看>>
SpringBoot集成MyBatis的分页插件PageHelper
查看>>
ScrollView嵌套EditText联带滑动的解决的方法
查看>>
学习笔记(九)并发(三)
查看>>
Logstash写入MongoDB数据库
查看>>
Android ViewPager系列之ViewPager一屏显示多个子页面
查看>>
Spark Mllib里如何建立密集向量和稀疏向量(图文详解)
查看>>
deeplearningbook-chinese
查看>>
Android零基础入门第51节:进度条ProgressBar
查看>>
文件的行操作
查看>>
数组初始化 和 vector初始化
查看>>