您的位置:首页 > Web前端 > CSS

css知识点

2012-07-24 07:49 253 查看
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>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: