css3杂记
来源:互联网 发布:如何盗用淘宝图片 编辑:程序博客网 时间:2024/06/06 18:28
本文随手记录了一些项目遇到的关于css的知识;
1.text-overflow: clip|ellipsis;text-overflow 属性规定当文本溢出包含元素时发生的事情;注意的是使用text-overflow:ellipsis时,当前容器的font-size是对它有影响的。
2.页面使用弹出的时候经常需要使用到蒙版,即一个平铺整个页面的半透明层,这个时候就需要一个div的宽高跟页面一致;可以使用以下方法,注意定位一定是要有并且一定是fixed;
.div { position: fixed; z-index: 100; top: 0; left: 0; width: 100%; height: 100%; }
3.css Stickt footers
注意下图,一般我们做蒙版的时候,下边那个按钮不是固定在底部的,当页面内容过长,按钮是在内容的下方;当内容正常的时候,按钮是固定在页面的指定位置;这种布局,大家称之为css Stickt footers;
实现css Stickt footers的基本方法:
先理清案例的dom结构。.detail是父级div,.detail-wrapper和.detail-close是同级的div,是.detail的子集;下面是less的写法;
.detail { position: fixed; z-index: 100; top: 0; left: 0; width: 100%; height: 100%; overflow: auto; .detail-wrapper{ width: 100%; min-height: 100%; } .detail-close { position: relative; width: 32px; height: 32px; margin: -64px auto 0 auto; clear: both; } }
阅读全文
0 0
- css3杂记
- 杂记
- 杂记
- 杂记
- 杂记
- 杂记
- 杂记
- 杂记
- 杂记
- 杂记
- 杂记
- 杂记
- 杂记
- 杂记
- 杂记
- 杂记
- 杂记
- 杂记
- x264分析
- finecms基础操作
- mysql使用int作为时间,怎么转换?FROM_UNIXTIME
- 如何让stm32L151工作在使用LL库的情况下 ,运行在32M时钟
- tomcat启动报错:A child container failed during start
- css3杂记
- Educational Codeforces Round 31 E. Binary Matrix 并查集
- Gradle 完整指南(Android)
- pg_dump数据保存问题
- intent方式调用camera
- 有序集合和无序集合
- UML图中类之间的关系:依赖,泛化,关联,聚合,组合,实现
- Centos7 Docker 安装
- mac os x下配置Android Studio 的 gradle