css知识点

css样式表:用法            常用属性      选择器

css主要有:元素内联(行内样式)<input  />            页面嵌入样式<style type=“text/css”>                   input       {}         </style>            外部样式<link href="css/stylesheet.css" rel="stylesheet" type="text/css"/>

样式的常用属性:background-color                 background-position     background-border     border-style:solid     border-style:dotted     border-color     display元素是否显示     cursor鼠标显示的光标图标     盒子模型:margin边距               padding填充         border         选择器:标签选择器,class选择器,ID选择器,包含选择器P,组合选择器 伪选择器A:为标签的不同状态设定不同的演示

标签选择器 input { width:200px; }

class选择器 .cls { width:200px; } .cls1 { height:200px; border:solid 1px red; }

ID选择器 #btn { width:50px; color:red; }

组合选择器 .clss,#b1,p { width:50px; color:red; }

伪选择器 a.link { color:blue; }

a:visited { color:red; }

a.hover { text-decoration:underline; color:green; }

a.active { color:gray; }

发生冲突时就近原则 <body> <div class="cls cls1"> <div> <input class="cls" type="text"/><br/> <input id="btn" type="text"/><br/> <a href="dfgdfgd">baidu</a><br/> </body>

 

 

 

 

 

 

 

 

 

 

 

 

 

posted @ 2012-07-24 07:49  zxp19880910  阅读(140)  评论(0编辑  收藏  举报