First, background:
With the development of the Internet, the personalized requirements of web pages are constantly improving. Html,hypertextmarkuplanguage, Hypertext Markup Language, the original is a description of the text, but users need more tags and attributes, and then kept add HTML tags and attributes, resulting in Web page content and style confusion, not easy to maintain. So, at this time, CSS turned out to achieve the Web content and style of separation, greatly improve the efficiency of writing, modify the page!
second, what is CSS?
CSS (cascading style Sheets), cascading style sheets, is the style, content, like a hamburger, one layer of a stack up, sandwich
third, what is the CSS selector?
CSS selectors are required to control the elements in an HTML page using CSS for one-to-many (ID), a-to-Multiple (class), or multiple-pair (tag). In fact, it is a matchmaker, to CSS and HTML matchmaking.
ID selector like ID card, one person, more targeted; class selectors are common in easyui, such as setting the class of the Easyui inside the control to Easyui-datagrid, and the table style can be well unified. Personally feel that if you do a large system with a lot of subsystems, class selector has a good ability to unified lakes and rivers; Tag Selector, regardless of your head (head) or arm's leg (body), is within the control of the label ~
Type and priority of CSS selectors:
ID selector >class Selector >html Tag Selector
The following is a small demo to verify the priority of the selector:
1. First create a CSS style sheet on the client, the code is as follows,
/** Founder: Wang Mei * created: February 23, 2015 16:14:53*//*CSS style *//* Tag Selector */body { color: #f0f;/* Pink */}/* class selector */.menu { color:# f00; /* Red */}.title { /* news heading style * /color: #00f;/* Blue */}/*id Selector */#special { font-weight:bold;/* Bold */ color : #0f0,/* Green */}
2. Create an HTML page:
<! DOCTYPE html>
3. Show results after running:
4. In summary, column four ID is special, class is menu,special in CSS color is green, menu font color is red, column four is green, proof priority ID Selector >class selector: Inside the body HTML tag, there is a class red, the default bodyhtml label format is pink, the priority class selector >html Tag Selector
Iv. Summary
Abstraction drives programming progress.
The css--"Beef Brisket Press Release system" you never tasted.