美文网首页
css 样式快捷

css 样式快捷

作者: 蛋壳不讲武德 | 来源:发表于2019-02-21 11:46 被阅读0次

好记星还是好记性都不如烂笔头,记录简短属性,方便查询遗忘的css技巧,总结加深记忆

1,::first-letter伪元素对display:table;display:flex;无效。字符前面不能有图片或者inline-table之类的元素存在。

2,opacity和transform等新属性会影响元素的z-index。

3,word-break打的是单词间的注意,word-wrap打的是间隙标点分割的注意。word-spacing是单词之间间距的,white-space是字符是否换行显示的。

4,图片元素下方缝隙,默认有文本节点存在,行高的上下空间 (vertical-align:baseline;)导致,可以img { display: block; }; 或vertical-align:bottom vertical-align:middle vertical-align:top;或让line-height足够小或 让font-size: 0;。

5,flex(弹性盒)布局属性display: -webkit-box; display: -ms-flexbox; display: flex; display: -webkit-flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; position: relative;水平justify-content根据排列模式自己再填写。

6,background 分解属性 background-image: url(images/bg.png); background-repeat: no-repeat; background-size: cover; background-position: left top;多个图片作为背景时候,background-image: url(l-t.png), url(r-t.png),url(l-b.png),url(r-b.png); background-repeat: no-repeat; background-position: left top, right top,left bottom,right bottom; background-size: 5%, 20%,10%,5%;分别设置。

7,a标签点击阴影问题a:focus {outline: none; border: none;outline-style:none; -moz-outline-style: none;},a { text-decoration: none; -webkit-tap-highlight-color: rgba(0,0,0,0); -webkit-touch-callout: none; -webkit-user-select: none;}。

8,img{-webkit-touch-callout: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -khtml-user-select: none; user-select: none;};

9,-webkit-overflow-scrolling:touch;  属性控制元素在移动设备上是否使用滚动回弹效果,流畅滑动。

10,单行省略号overflow: hidden;text-overflow:ellipsis;white-space: nowrap;。

双行省略号: 

text-overflow: -o-ellipsis-lastline;  overflow: hidden;  text-overflow: ellipsis;  display: -webkit-box;  -webkit-line-clamp: 2;  line-clamp: 2;  -webkit-box-orient: vertical;

11、弹性和布局display: -webkit-box; display: -ms-flexbox; display: flex; display: -webkit-flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center;justify-content: space-between; -webkit-justify-content: space-between;

12、绝对定位左右居中    left: 50%;top:50%;

transform: translate(-50%,-50%); -webkit-transform: translate(-50%,-50%);

position: absolute;

13、输入框占位符样式::-webkit-input-placeholder { color:#f00; }::-moz-placeholder { color:#f00; } /* firefox 19+ */:-ms-input-placeholder { color:#f00; } /* Internet Explorer 10+ */:-moz-placeholder { color:#f00; } /* firefox 14-18 */

14、透明遮罩层   width:100%;height:100%;position:fixed;top:0; background:rgba(0, 0, 0, 0.6);z-index:11;left:0px; 

15、css 选择器

16、断行

white-space: pre-wrap;

17、文本渐变色  

font-size: 20px;

font-weight: bold;

background: linear-gradient(to bottom, #f0d8b6, #99745a);

background: -webkit-linear-gradient(to bottom, #f0d8b6, #99745a);

-webkit-background-clip: text;

-webkit-text-fill-color:transparent;

color: #99745a;

18、swiper  全屏滚动 到最后底部时  只滚动底部高度

其他设置height:100%  底部设置固定高度

初始化是设置 

slidesPerView :'auto',

direction: 'vertical',






相关文章

  • css 样式快捷

    好记星还是好记性都不如烂笔头,记录简短属性,方便查询遗忘的css技巧,总结加深记忆 1,::first-lette...

  • HTML // CSS

    HTML常用标签 CSS 样式与选择器 快捷语法

  • CSS选择器

    Ctr+/ 注释的快捷键 一.引入CSS 1.行间样式 1 --> 2.页面级CSS 接head中style ...

  • css样式入门书目录

    css样式-字体属性 css样式-背景属性 css样式-边框属性 css样式-列表属性 css样式-定位属性 cs...

  • 04.CSS基础01

    0.快捷键: 1.css定义 2.如何编写css样式 css语法选择符,属性声明,括号,换行不敏感,空格不敏感。d...

  • 2019-07-20

    1、打字练习2、快捷键3、w3C html--到html链接css--css基础教程+css样式4、红宝书1-4章...

  • [jQuery]设置css样式

    获取css样式 设置单个css样式 设置多个css样式

  • CSS基础(二)

    1 - CSS样式的引入 CSS样式的引入可以采用三种方式: 内联式css样式 嵌入式CSS样式 外部式CSS样式...

  • 切图需要的准备

    样式 重置样式(reset.css) 公共样式(commo.css) 独立样式(例如首页:index.css) 重...

  • jQuery学习:css操作/属性操作

    css操作 修改单个样式.css(name,value) 修改多个样式.css(obj) 获取样式.css(nam...

网友评论

      本文标题:css 样式快捷

      本文链接:https://www.haomeiwen.com/subject/tkhaeqtx.html