HTML and CSS Reference
In-Depth Information
Figure 3.1: Nested horizontal and vertical lists
he use of a plus sign (+) between two element names indicates a selection
based on the status of an element as an adjacent sibling to another element.
For example, if this CSS statement
h3 + ul { margin-top: 0; }
were added to the style element in Example 3.1, it would reduce the margin of
space between level-three headings and the list items that immediately follow
them. But it would not afect the nested lists, because they are not adjacent to
the headings.
Document elements can be selected based on whether the element has a
particular attribute, or whether the element has an attribute with a particular
value. A CSS statement such as this
a[name] { color: cyan; }
selects any anchor element that has a name attribute. Such anchors are usually
the in-page destinations of hyperlinks. he preceding CSS highlights all such
elements by coloring them cyan. To select an HTML element by the value of
an attribute, follow the name with an equals sign (=) and the value in quotes:
 
Search WWH ::




Custom Search