CSS-[Niuke news publishing system] and css news publishing system
I. background:
With the development of the Internet, the personalized requirements of web pages are also constantly improved. HTML, HyperTextMarkupLanguage, and hypertext markup language are plain text, but users need more labels and attributes, and then add HTML tags and attributes, the webpage content and style are messy and cannot be easily maintained. At this time, CSS was born, realizing the separation of webpage content and styles, greatly improving the efficiency of writing and modifying pages!
Ii. What is CSS?
CSS (CasCading Style Sheets), stacked Style sheet, is a Style, content like a hamburger, layer by layer, sandwich ~
3. What is the CSS selector?
CSS selector is used to control one-to-one (ID), one-to-many (class), or multiple-to-one (TAG) elements on HTML pages. In fact, it is a matchmaker, connecting css and html.
The ID selector is similar to the ID card. It is more targeted for one person. class selector is often used in easyUI. For example, you can set the class in the control in easyUI to easyUI-datagrid, table styles can be well unified. I personally think that if many subsystems are attached to a large system, the class selector has a unique capability. The label selector, regardless of your head ), or the arm and leg (body) are all under the control of the tag ~
Type and priority of the CSS selector:
ID selector> class selector> HTML Tag Selector
The following uses 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,
/** Created by: Wang Mei * Creation Time: February 23, 2015 16:14:53 * // * css style * // * tag selector */body {color: # f0f; /* pink */}/* class selector */. menu {color: # f00;/* red */}. title {/* news title style */color: # 00f;/* Blue */}/* ID selector */# special {font-weight: bold; /* Bold */color: #0f0;/* green */}
2. Create an HTML page:
<! DOCTYPE html>
3. The result is displayed after running:
4. To sum up,Topic 4The class is menu. In css, the special color is green, the font color of menu is red, and column 4 is green. The priority ID selector> class selector is proved; in the body HTML Tag, the class is red. The default bodyHTML tag format is pink, which proves that the priority class selector> HTML Tag Selector
Iv. Summary
Abstract promotes programming progress.