Basic syntax
Rule
Select
Any HTML element can be a selector of CSS1. The selectif is merely an element that points to a special style. E.g,
P {text-indent: 3em}
The selector is P.
Class selector
Single selection can have different Class (classes), thus allowing the same element to have different styles. For example, a web maker may wish to deserve its language, display code with different colors:
Code.html {Color: # 191970}
Code.css {color: # 4b0082}
The above example establishes two classes, CSS, and HTML for use in HTML Code elements.
The class attribute is a class for specifying elements in HTML, for example,
P.WARNING {Font-Weight: bolder; color: red; background: white}
ID selector
The ID selector individually defines the ingredients of each element. This selector should be used as little as possible because he has certain limitations. Specify an ID selector to have an indicator "#" in front of the name. For example, the ID selector can be specified as follows: # svp94o {text-indent: 3em} This can refer to the ID attribute in the HTML:
text indentation 3EM P> associated selection association selection only It is a string composed of two or more single selectors separated by spaces. These selectors can specify general properties, and because of the laminated rules, their priority is larger than the single selection. For example, the following context selector p em {background: Yellow} is P EM. This value indicates that the emphasis text in the paragraph will be a yellow background; and the stressed text of the title is not affected.