MooTools selects an element (or a set of elements) in the DOM using CSS selectors syntax.
Just a quick refresher on CSS terminology; a CSS style rule consists of:
selector { property: property value; }
selector
—indicates what elements will be affected by the style ruleproperty
—refers to the CSS property (also referred to as attribute). For example,color
is a CSS property, so isfont-style
. You can have multiple property declarations in one style rule.property value
—the value you want assigned to the property. For example,bold
is a possible CSS property value of thefont-weight
CSS property.
For example, if you wanted to select a paragraph element with an ID of awesomeParagraph
to give it a red color (in hexadecimal, this is #ff0)
, in CSS syntax you'd write:
#awesomeParagraph { color: #ff0; }
Also, if I wanted to increase its specificity and make sure that only paragraph elements having an ID of awesomeParagraph
are selected:
p#awesomeParagraph { color:...