CSS Mastery摘要(1)--Getting Your Styles to Hit the Target
来源:互联网 发布:江苏国税普通发票软件 编辑:程序博客网 时间:2024/06/09 13:51
we’ve used the ::first-letterpseudo-element to create a drop-cap letter in a different font at the beginning of the paragraph.
.comment:target:not(.comment-downvoted) { background-color: #fffec4;}
tr:nth-child(3n+4) { background: #ddd;}
Back in CSS 2.1 there was a pseudo-element for the first child, sensibly named:first-child, so:nthchild(1)can be written more simply using that. The Level 3 selectors specification adds a corresponding one for the last child, named (you guessed it) :last-child, corresponding to:nth-last-child(1). There’s also :only-childand:only-of-type. The:only-of-typeselector applies to an element if it is the only child element that is of a particular element type. We can get more advanced with targeting elements of a certain type by using these pseudo-class selectors:
:nth-of-type(N)
:nth-last-of-type(N)
Form Pseudo-Classes
/* When the field contains a valid email address: */input[type="email"]:valid { border-color: green;}/* When the contents are not a valid email address: */input[type="email"]:invalid { border-color: red;}
People often confuse inheritance with the cascade. Although they seem related at first glance, the two concepts are actually quite different.
Inherited property values have no specificity at all, not even zero. This means that properties set via the universal selector, which has a specificity of zero, will override inherited properties.
- CSS Mastery摘要(1)--Getting Your Styles to Hit the Target
- Hit the Target!
- CSS Mastery摘要(3)--Web Typography
- CSS Mastery摘要(4)--Beautiful Boxes
- CSS Mastery摘要(5)--Content Layout
- CSS Mastery摘要(7)--Responsive Web Design & CSS
- 《CSS Mastery》 Chapter 1 问题解决
- CSS: Anchor styles [The right way to do it]
- The Definitive Guide to Getting Your Linux Desktop Back
- CSS Mastery摘要(2)--Visual Formatting Model Overview
- CSS Mastery摘要(6)--Page Layout and Grids
- CSS Mastery摘要(8)--Styling Forms and Data Tables
- CSS Mastery
- zoj 3597 Hit the Target! (线段树)
- HTML CSS: the language of web-getting to know HTML
- 求大神路过指导ZOJ3597 Hit the Target!
- zoj zju 3597 Hit the Target! 线段树 扫描线
- Getting Your Feet Wet with the SWT
- 大学期末考试SSM试题三
- 网络流 最小路径覆盖 二分图最大匹配
- Groovy初步了解
- php7环境下ThinkPHP报错:Cannot use 'String' as class name as it is reserved
- 动态规划 最长公共子序列
- CSS Mastery摘要(1)--Getting Your Styles to Hit the Target
- leetcode Perfect Number 完全数
- 一种别样的打印Log的方式
- Ubuntu下SVN服务的搭建(apache2+svn)
- IO-01-字节流与字符流
- loadrunner的学习
- 【密码学】C语言实现AES核心步骤
- LeetCode-矩阵旋转
- 1064. 朋友数(20)