CSS study notes

xiaoxiao2021-03-06  58

CSS is an abbreviation for Cascading Style Sheets. It is a simple mechanism for adding styles to web documents, which belongs to the layout language of the performance layer.

Call style sheet

Basic syntax specification analysis A typical CSS statement:
P {color: # ff0000; Background: #ffffff} in "P" We call "selectors", indicating that we want to define style to "P"; Style declaration writes in a pair of braces "{}"; Color and Background are called "property" and different attributes with semicolons ";" separated; "#f0000" and "#fffff" are attributes Value. Color value color values ​​can be written with RGB values, such as: color: RGB (255, 0, 0), can also be written with hexadecimal, like the above example color: # ff0000. If the hexadecimal value is a repetitive, the effect is the same. For example: #f0000 can write to # f00. But if you don't repeat, you should not be short-written, for example # fc1a1b must write over six. Defining font Web standards recommend the following font definition method:
Body {Font-Family: "Lucida Grande", Verdana, Lucida, Arial, Helvetica, Song, Sans-Serif;} The font is selected in the order listed. If the user's computer contains the Lucida Grande font, the document will be specified as Lucida Grande. No, it is specified as a Verdana font. If there is no Verdana, it is specified as a Lucida font, and the Lucida Grande font is suitable for Mac OS X; Verdana font is suitable for all Windows systems; Lucida is suitable for UNIX users; "Song" is suitable Chinese Simplified users; if the fonts listed cannot be used, the default SANS-Serif font ensures call; the group selector When several element style properties, you can call a statement, and the elements are separated by commas: P, TD, Li {Font-Size: 12px;} Derife Selector Defines the Sub Elements in Elements Use the derived selector, for example: li strong {font-style: italic; font-weight: Normal;} It is the subsidence of the subsidence from the child. Strong is defined for the subsidence of the LI. The ID selector uses the CSS layout mainly with the layer "div" to implement, while the DIV style is defined by the "ID selector". For example, we first define a layer

转载请注明原文地址:https://www.9cbs.com/read-113575.html

New Post(0)