各种常用的css样式(收集整理)

来源:互联网 发布:网络维修属于什么工作 编辑:程序博客网 时间:2024/05/20 23:57
a{text-decoration:none;}  //A标签去掉下划线a{cursor:pointer;}  //鼠标手型样式li{list-style:none;}  //列表样式:无。li标签去掉点em{font-style:normal}  //去掉EM标签斜体样式,初始化代码/* CSS圆角样式,兼容 */-moz-border-radius: 15px; /* Firefox */-webkit-border-radius: 15px; /* Safari 和 Chrome */border-radius: 15px; /* Opera 10.5+, 以及使用了IE-CSS3的IE浏览器 */p:first-child{background-color:yellow;} // :first-child 选择器用于选取属于其父元素的首个子元素的指定选择器p:last-child{ background:#ff0000;} // :last-child 选择器匹配属于其父元素的最后一个子元素的每个元素p:nth-last-child(2){background:#ff0000;} // :nth-last-child(n) 选择器匹配属于其元素的第 N 个子元素的每个元素,不论元素的类型,从最后一个子元素开始计数p:nth-last-child(odd){background:#ff0000;} // 奇数行p:nth-last-child(even){background:#0000ff;} // 偶数行p:nth-last-child(3n+0){background:#ff0000;} // 倍数行用a标签实现跳转到本页面或者目标页面的顶部、底部或者某一位置:1、定义目标位置,赋予id。2、给a标签添加href为#id。

"target_blank" // 浏览器会另开一个新窗口显示document.html文档<base target="_blank" />  //在head标签内添加。所有a标签跳转到新页面


原创粉丝点击