另一种特殊选择符是ID选择符。
属性选择符有四种匹配方式。
CSS规则由一个选择符和一个声明块组成。
基本页面和通用选择符
如果它的所有内容都匹配,则简单选择符匹配。
仅次于类型选择符最常用的选择符是类选择符。
After type selectors, the most commonly used selectors are class selectors.
全局选择符,写做"*",匹配任意元素类型名。
The universal selector, written "*", matches the name of any element type.
类选择符选择class属性为特定值的所有元素。
A class selector selects all elements that have a class attribute with a particular value.
一个1字节的选择符域。
文档树中匹配一个选择符的元素称为那个选择符的主题。
The elements of the document tree that match a selector are called subjects of the selector.
在这种情况下,选择符是祖先元素名后面跟着后代元素名。
In this case, the selector is the ancestor element name followed by the descendant element name.
按压向上向下按钮选择符单点式或中央偏重测光。
Press the updown buttons to select either spot metering or enter-weighted average metering.
包含一个简单选择符的选择符,匹配任意符合它要求的元素。
A selector consisting of a single simple selector matches any element satisfying its requirements.
另外一个新支持的选择符将是相邻选择符,使用"+"符号。
The other newly supported combinator will be the Adjacent Sibling combinator, designated by a "+" symbol similarly placed between simple selectors.
可以参考图2,了解HTML、ID和类选择符的css语法。
You can refer to Figure 2 to quickly check the CSS syntax for HTML, ID, and class selectors.
为了演示不同CSS选择符的用法,我在本文中使用一次狗展的结果。
To demonstrate the use of different CSS selectors, I use in this article the results of a dog show.
样式的选择符以这个HTML标记开头,后面是一个描述这个样式的扩展。
So the selector for the style starts with the HTML tag and is followed by an extension that describes the style.
这个选择符用于选择出特定的单一元素;id在一个文档中应该是惟一的。
This selector is used to single out a particular element; IDs should be unique within a document.
选择符及其定义组成一组规则,这些规则控制相关HTML文档的显示方式。
Together the selectors and their definitions work as set of rules that govern the presentation of any associated HTML documents.
与类选择符相似,ID选择符也基于一个属性的值,但这个属性是ID属性。
Like the class, an ID selector is based on the value of an attribute, but in this case, it's the ID attribute.
讨论各种XPath选择符,如何根据自己的需要进行特定或一般化的搜索。
It covers the various selectors XPath provides for being as specific or generic in a search as you like.
在全局范围使用类的优点是在选择符中不需要使用标记名,只需为类指定样式。
The advantage of using classes globally is that instead of having to marry a given class to that selector, you can simply create a class with a style.
最常用的选择符可能是类型选择符,但是大多数人把它称为标记名或元素选择符。
Perhaps the most commonly used selector is the type selector, though most people think of it as a tag name or element selector.
还要注意组选择符,也就是两个或更多的选择符组合在一起,使用相同的样式声明。
Also notice the use of group selectors, where two or more selectors are grouped together to have the same style declarations.
如图中所示,选择符在规则的左边,它定义了文档中受影响的那些元素。
The selector, shown on the left side of the rule, defines which piece of the document will be affected.
样式表把属性(可以控制的属性)和值(为这些属性选择的值)与样式选择符联系起来。
The style sheet attaches properties (attributes that you can control) and values (your choices for the attributes) to the style selectors.
经常的,要保持CSS的整洁度和有序性。我喜欢将选择符按照样式的类别进行组织划分。
Always, always keep your CSS clean and organized. I prefer organizing my selectors by style groups.
当使用后代选择符,右边的一个元素选择器是被选择的,不管左边的元素选择器标签有几个。
When using the descendant combinator, an element selector on the right is selected if it falls anywhere between the tags of the element selector on the left.
这里的工作和刚才对显示的处理差不多:一个具有许多选择符、规则和格式的CSS样式表。
Most of this is the same old presentation you've always been doing: a CSS stylesheet with lots of selectors, rules, and formatting.
这里的工作和刚才对显示的处理差不多:一个具有许多选择符、规则和格式的CSS样式表。
Most of this is the same old presentation you've always been doing: a CSS stylesheet with lots of selectors, rules, and formatting.
应用推荐