First, CSS:
is a cascading style that is used to beautify the page
second, the difference between HTML and CSS
HTML effect:
determines the content and structure of the Web page
CSS Effect:
beautify the Web page, specifically to beautify and decorate the HTML tag .
Third, CSS syntax:
Selector {
Attribute 1: value 1;
attribute 2: value 2;
}
four, the basic selector:
HTML tag Selector, class selector, ID selector
HTML Tag Selector:
when declaring: The selector name is the HTML tag name, which must be the tag names that exist on the page .
application: Automatically apply on this class tag
Application Range:
the same style is used throughout the page for all of these tags, which means
HTML tags re-used on similar tags
class Selector
when declaring: Name with "." Any name that starts with
when applied: Apply with the class attribute of the HTML tag, specifying the class selector name without adding "."
Application Range:
class selectors can be applied on any tag, and can be reused multiple times
NOTE: Class selectors take precedence over HTML tag selectors
ID Selector
when declaring: Any name with the name beginning with "#"
when applied: Use the id attribute of the HTML tag to specify the class selector name without adding "#"
Application Range:
The ID selector can be applied on any tag but not reused on the same page and applied only on one tag
Priority level:
ID selector > class selector >html tag Selector
CSS Basics, selectors