web前端入门到实战:CSS3两大实用属性,以及网页制作技巧
我们通常的做法是先给每个菜单项设置边框,然后在设置最后一个菜单的边框为零
不过不要这么做,使用 :not() 伪类来达到同样的效果:
当然,你也可以使用 .nav li + li 或者 .nav li:first-child ~ li ,但是 :not() 更加清晰,具有可读性
二、使用:nth-child(n)选择项目
(注:第一个子元素的下标是 1)
:nth-child(3) 表示选择列表中的第三个元素
:nth-child(2n)表示列表中的偶数标签,即选择第2、第4、第6……标签
:nth-child(2n-1) 表示选择列表中的奇数标签,即选择 第1、第3、第5、第7……标签
:nth-child(n+3) 表示选择列表中的标签从第3个开始到最后(>=3)
:nth-child(-n+3) 表示选择列表中的标签从0到3,即小于3的标签(<=3)
:nth-last-child(3) 表示选择列表中的倒数第3个标签
:nth-of-type(n) 匹配属于父元素的特定类型的第 N 个子元素的每个元素
三、隐藏没有静音、自动播放的影片
再次,利用了:not()的优点
四、IE 条件注释
IE 中的条件注释对 IE 的版本和 IE 非 IE 有优秀的区分能力,是 Web 开发中常用的hack方法,能对 IE 系列产品进行单独的 HTML 代码处理
五、固定表格table-layout:fixed;
通常搭配word-wrap:break-word;和word-break:break-all;使用
CSS3 word-wrap 属性
word-wrap: normal|break-word;
web前端入门到实战:CSS3两大实用属性,以及网页制作技巧
CSS3 word-break 属性
word-break: normal|break-all|keep-all;
web前端入门到实战:CSS3两大实用属性,以及网页制作技巧
这里小编是一个有着5年工作经验的前端工程师,关于web前端有一个完整学习web前端的路线,学习材料和工具。需要的伙伴可以私信我,发送“前端”就可以获取领取地址,免费送给大家。对于学习web前端有任何问题(学习方法,学习效率,如何就业)都可以问我。希望你也能凭自己的努力,成为下一个优秀的程序员!
如需转载,请注明文章出处和来源网址:http://www.divcss5.com/css3-style/c58293.shtml
- 上一篇: 必须了解的css知识,纯干货
- 下一篇: 你可能不知道的10个CSS3中的隐藏特性
必备CSS教程Essential CSS Tutorials
- css height
- css line-height
- css width
- css min-width
- css max-width
- css min-height
- css max-height
- css border
- css background
- css float
- css clear
- css display
- css font
- css text-transform
- css英文首字母大写
- css font-variant
- css font-weight
- css font-style
- css text-decoration
- css 删除线
- div css 虚线
- css 注释
- html 注释
- css padding
- css margin
- css 文本
- css font-size
- css font-family
- css color
- css text-align
- css text-indent
- css 超链接( css a)
- css 优化压缩
- css id( css #)
- css class( css .)
- css ul li列表
- css 圆角圆边
- css 父级子级
- css 指针概念
- css cursor
- css overflow
- html px em pt网页单位
- CSS important
- CSS position
- css z-index
- css white-space
- css img图片
- css class id
- css link与@import区别
- css 选择器
- css引入html
必备HTML基础教程Essential HTML Tutorials
- html img图片标签
- html em标签( EM强调标签)
- html strong加粗( strong标签)
- html B加粗( b加粗标签)
- strong与B加粗区别
- h1 h2 h3 h4标签( html标题标签)
- html A超链接锚文本
- html注释
- html head头部标签
- html title标题标签
- html meta标签
- html link标签
- html i斜体标签
- html u下划线标签
- html s删除线标签
- html换行br标签
- html p段落标签
- p标签与br标签区别
- html div标签元素
- html span标签
- html font标签
- html script标签
- html px em pt网页单位
- html ul li列表
- ol li列表
- dl dt dd标签组
- table tr td表格
- table tr th表格
- html form表单
- html form input
- html form textarea文本区域
- html select下拉与跳转( Html select)
- html iframe框架
- html网页结构
- htm html shtml区别用法
- 网页编码charset
- UTF-8 GBK UTF8 GB2312区别联系
- 先写html还是先写CSS
- 显示扩展名
- html标签大全集合
- html常用标签
- 网页源代码是什么