自己做一个关于:target的简单实验。ff3.x浏览可见效果,IE系列暂不支持。
:target是CSS3新推出的一个伪类选择器,作用于那些使用了锚标记name的链接。而通过:target可以针对指定的target对象定义样式。在这些target被激活时,可见这些样式的变化。
为了更好地展示:target的效果,首先需要几个文字段落。文字段落引自W3C对于:target的解释。
段落一:
Some URIs refer to a location within a resource. This kind of URI ends with a “number sign” (#) followed by an anchor identifier (called the fragment identifier).
段落二:
URIs with fragment identifiers link to a certain element within the document, known as the target element.
段落三:
A target element can be represented by the :target pseudo-class. If the document’s URI has no fragment identifier, then the document has no target element.
CSS:
1 2 3 4 5 | *:target{
padding:10px;
border:dotted 1px #ddd;
color:#799B13;
} |

