随笔分类 -  CSS

Better CSS
CSS特异性——优先级
摘要:http://www.w3.org/TR/CSS2/cascade.html#specificity特异性选择器的特异性由CSS2 规范定义如下:如果声明来自于“style”属性,而不是带有选择器的规则,则记为 1,否则记为 0 (= a)记为选择器中 ID 属性的个数 (= b)记为选择器中其他属性和伪类的个数 (= c)记为选择器中元素名称和伪元素的个数 (= d)将四个数字按 a-b-c-d 这样连接起来(位于大数进制的数字系统中),构成特异性。 阅读全文

posted @ 2013-05-03 10:22 BigPalm 阅读(232) 评论(0) 推荐(0)

CSS默认样式表
摘要:原文地址:www.w3.org/TR/CSS2/sample.htmlhtml, address,blockquote,body, dd, div,dl, dt, fieldset, form,frame, frameset,h1, h2, h3, h4,h5, h6, noframes,ol, p, ul, center,dir, hr, menu, pre { display: block; unicode-bidi: embed }li { display: list-item }head { display: none }table ... 阅读全文

posted @ 2013-05-02 20:32 BigPalm 阅读(220) 评论(0) 推荐(0)

haslayout综合
摘要:原文地址:http://www.qianduan.net/comprehensive-haslayout.html/comment-page-1#comment-300580什么是 haslayout ?haslayout 是Windows Internet Explorer渲染引擎的一个内部组成部分。在Internet Explorer中,一个元素要么自己对自身的内容进行计算大小和组织,要么依赖于父元素来计算尺寸和组织内容。为了调节这两个不同的概念,渲染引擎采用了 hasLayout 的属性,属性值可以为true或false。当一个元素的 hasLayout 属性值为true时,我们说这个元 阅读全文

posted @ 2013-04-27 01:03 BigPalm 阅读(179) 评论(0) 推荐(0)

CSS 常见继承属性
摘要:继承性:“后代元素”继承“祖先元素”属性设置的性能1.字体属性:font-family;font-size;font-weight;font-variant;font-style;2.文本属性:text-align;text-indent;line-height;letter-spacing;word-spacing;text-transform;direction;3.列表属性:list-style-type;list-style-image;list-style-position;4.其他visibility;color;cursor; 阅读全文

posted @ 2013-04-25 16:45 BigPalm 阅读(219) 评论(0) 推荐(0)

Unitless line-heights
摘要:line-height<ul> <li>I'm a list item with <small>small text</small>.</li></ul>ul {font-size: 15px; line-height: 1em;}li {font-size: 10px;}small {font-size: 80%;} li将继承ul的line-height:15px,为15px(15px*1),small的line-height也为15pxul {font-size: 15px; line-height: 1;} 阅读全文

posted @ 2013-04-25 16:23 BigPalm 阅读(209) 评论(0) 推荐(0)

CSS 在IE6, IE7 和IE8中的差别
摘要:原文地址:http://www.jb51.net/css/21991.html选择器与继承子选择器示例body > p { color: #fff;}描述子选择器选择一个特定父级元素的所有直接子级元素,在上面的例子中,body是父元素,p是子元素。支持情况IE6NoIE7YesIE8YesBugsIE7中,如果在父级标签和子级标签之间有一个HTML注释,子选择器将不会工作。链类示例.class1.class2.class3 { background: #fff;}描述链类用于送一个HTML元素有多个class声明的情况,就像这样:<div class="class1 cl 阅读全文

posted @ 2013-04-24 23:47 BigPalm 阅读(241) 评论(0) 推荐(0)

CSS hide and show
摘要:1. IE<=6/Win 不识别CSS2高级选择器(IE5/MAC支持)1 .buggybox {height: 1%;} /* for all browser */2 #parentElement>.buggybox {height: auto;} /* fix for browser except IE<=6/Win */2. 只有IE<=6/Win,IE/MAC识别* html选择器 && MAC-hack1 /* Hides from IE5-mac \*/2 * html .buggybox {height: 1%;} /* just for 阅读全文

posted @ 2013-04-24 21:45 BigPalm 阅读(397) 评论(0) 推荐(0)

导航