[学信网]学习网页标准制作技术之CSS相关基础知识

更新时间:2014-09-18    来源:CSS相关    手机版     字体:

【www.bbyears.com--CSS相关】

一、三种样式选择器
属性选择器 p {color:red;}
类选择器 .p {color:red;}
ID选择器 #p {color:red;}
二、transparent
Background:transparent; 防止定义背景被覆盖
三、Netscape4.X(IE/WINDOWS4.0以前的版本)下错误的透明背景理解
Background:inhrit; 在netscape4.x下透明背景将被理解为黑绿
四、字体默认选择:
Body {font-family:”lucida Grande”,Verdana,Lucida,Arial,Helvetica,sans-serif; }
按顺序调用不同平台的默认字体
五、如何解决旧浏览器不支持CSS的情况
使用群选择器 例如:p,td,ul,ol,li,dl,dt,dd {font-size:small;}
六、使用netscape4友好规则
Body {font-family:Verdana,sans-serif;}
p,td,ul,ol,li,dl,dt,dd {font-size:small;}
七、方法重载细节规则:
Body {font-family:Verdana,sans-serif;}
p,td,ul,ol,li,dl,dt,dd {font-size:small;}
p {font-family:times,”Times New Roman”,serif;}
八、内容(派生)选择器
Li strong {font-style:italic; font-weight:normal }
例如:strong {color:red;} h2{color:red;} strong h2 {color:blue;}
例如:#sidebar {color:red} #sidebar p {color:blue;}
例如:.fancy {color:red;} .fancy p {color:blue;} / li.fancy {color:black;}

本文来源:http://www.bbyears.com/wangyetexiao/9359.html