随笔分类 -  css

css
摘要:.link:before{content: "/";margin:0 24px;color: grey;} .link:first-child:before{display:none;} 阅读全文
posted @ 2016-03-12 11:31 jayruan 阅读(128) 评论(0) 推荐(0)
html,body最顶层元素.
摘要:1,元素百比分是相对父元素,所有元素默认父元素是body. absolute,fixed[只有一个父元素,浏览器窗口]除外[浏览器窗口,为父元素].css3:vh,vw也永远相对,浏览器窗口.height: 10% == 10vh;absolute:height:100%和height:inheri 阅读全文
posted @ 2016-03-05 11:11 jayruan 阅读(1276) 评论(0) 推荐(0)
clearfix
摘要:过渡放在原:transiton:2s; 块无素:block,inline inline-block1,占一行,有宽,有高内元素:2,无宽高,内容撑开宽高。不支持上下margin.代码换行补解析。3, 一行,有宽,有高。不设宽度,要内容撑开。float:浮动元素.clearfix{*zoom:1;}. 阅读全文
posted @ 2016-02-29 06:33 jayruan 阅读(218) 评论(0) 推荐(0)
animation
摘要:animation-name xxxanimation-duration 8sanimation-timing-function linear,ease,ease-in,ease-out,ease-in-out,cubic-bezier(n,n,n,n) 0到1animation-delay 0sa 阅读全文
posted @ 2016-02-19 07:57 jayruan 阅读(401) 评论(0) 推荐(0)
都是以父元素的width为参照物的
摘要:本文依赖于一个基础却又容易混淆的css知识点:当margin/padding取形式为百分比的值时,无论是left/right,还是top/bottom,都是以父元素的width为参照物的!也许你会说,left/right以父元素的width为参照物好理解,但是top/bottom为什么也是以父元素的 阅读全文
posted @ 2016-02-13 11:26 jayruan 阅读(241) 评论(0) 推荐(0)
换行,横向撑大,字符间距
摘要:word-break: break-all;换行 word-wrap: break-word 换行[换行后,如果不是一个word 还要换行]white-space: nowrap;不换行,横向撑大[ white-space:nowrap;overflow:hidden;] word-spacing: 阅读全文
posted @ 2016-01-04 00:02 jayruan 阅读(427) 评论(0) 推荐(0)
cssTex
摘要:var head= document.getElementById("head");head.style.cssText="width:200px;height:70px;display:bolck";但cssText也有个缺点,会覆盖之前的样式。如TEST想给该div在添加个css属性widthd... 阅读全文
posted @ 2016-01-02 11:37 jayruan 阅读(264) 评论(0) 推荐(0)
CSS 垂直居中。
摘要:1,display: table;display: table-cell Testaaaaaaaaaaaaaaaaaaa Testaaaaaaaaaaaaaaaaaaa display:flex;flex-direction: row | row-reverse | column |... 阅读全文
posted @ 2016-01-01 12:01 jayruan 阅读(180) 评论(0) 推荐(0)