CSS Operation Properties ********one, the text1. Text color: Color property is used to set the color color of text is most often specified by CSS: hexadecimal value-Example: #ff0000 an RGB value-such as: RGB (255, 0,0) The name of the color-such as: Red2. Horizontal alignment Text-The align property specifies the horizontal alignment of the text in the element. Left to arrange the text to the Ieft. Default value: determined by the browser. Right to arrange the text to the left. Center arranges the text in the middle. Justify the effect of aligning the two ends. *****. Text Other operations font-size:10px; Font size Line-height:200px; Text line High-popular speaking, text height plus text up and down the white space height 50%: Based on percentage of font size vertical-align:-4px Sets the vertical alignment of element content, valid only for inline elements, invalid for block-level elements text-decoration:none text-The Decoration property is used to set or remove decorations for text. Mainly used to remove the underlined font of the link-family:'Lucida Bright'Font-weight:lighter/bold/border/Font-Style:obliquetext-indent:150px; First Line indent 150pxletter-spacing:10px; Letter Spacing Word-spacing:20px; Word spacing Text-transform:capitalize/uppercase/lowercase; text conversion, for all words to become uppercase or lowercase letters, or capitalize the first letter of each word3. Background Properties Background-Colorbackground-Imagebackground-Repeatbackground-Positionbackground-color:cornflowerblue background color background-image:url ('1.jpg'); Background image Background-repeat:no-Repeat, (repeat: Tiled full) is covered with background-position:right Top (20px 20px); Image location Shorthand: background:#ffffff url (' 1.png ') no-repeat right top;4. Border Properties Border-Style border styles (solid or dashed) border-Color Border Border-width Border thickness border-radius:50%Draw round Border-left/right/top/Bottom shorthand: border: Thickness style color5. List Properties ul/ollist-Style list Style none (no style)/circle (Circle)/square (block)/lower-Latin (English alphabet)6. Margin (margin) and padding (padding)1box model margin: Used to control the distance between elements and elements, and the most basic use of margin is to control the spacing of the space around the elements, and to achieve the goal of separating each other from a visual angle. padding: Used to control the distance between the content and the border; Border (border): a border around the inside margin and outside the content. Content: The contents of the box, displaying text and images. 2. Margin (margin) unilateral margin property margin-Top:100px;margin-Bottom:100px;margin-Right:50px;margin-left:50px: margin:10px 20px 20px 10px, top margin is 10px right margin is 20px bottom margin is 20px left margin is 10pxmargin:10px 20px 10px; The top margin is 10px and the left margin is 20px bottom margin is 10pxmargin:10px 20px; The upper and lower margins are around 10px and the margin is 20pxmargin:25px. All 4 margins are 25pxCenter App ********margin:0 Auto;3. Padding (padding) Use the Fill attribute alone to change the padding around the top and bottom. The abbreviation Fill property can also be used once everything changes. Set the same margin first knife: the outer border of the body is positioned by default in the upper-left corner of the browser window, but it does not fit the window border of the browser, because the body itself is also a box (the outer layer also has HTML), by default, The body distance HTML will have a number of pixels of margin, the specific value due to various browsers are different, so the body box will not close to the border of the browser window, in order to verify this, plus: body{border:1px solid; Background-Color:cadetblue;} "" "solution body {margin:0;} Second knife: margin collapse (boundary collapse or boundary overlap)1, Brother Div: margin of the top div-bottom and the margin-of the following Divtop will collapse, that is, will take the upper and lower margin of the maximum value as a display value2, parent-child Div:ifthere is no border,padding,inlinecontent in the parent Div, the margin of the child div is searched upward until a label is found that includes one of the border,padding,inline content, Then press this div for margin; "" The Solution: Overflow:hidden;7. Float Property Layout Key: How to allow the length of an element (label) to be displayed on one line if the previous is floating, then keep the vertical distance unchanged if the previous is not floatingBasic Floating Rules * * * *Let 's look at how the block element and inline elements are arranged in the document flow. The block element is usually separated by a single line, with the block element being a new row, and the default block element width automatically fills its parent element width. The block element can set the width, height, margin, padding property, the inline element does not have a single row, and multiple adjacent inline elements are arranged in the same row until the line is not arranged before a new line is changed, and its width varies with the contents of the element. inline element setting width, height property Invalid common block-level elements are div, form, table, p, Pre, H1~H5, DL, OL, UL, etc. Common inline elements are span, a, strong, EM, label, input, select, TextArea, IMG, BR, and so on so-called document flow, which refers to the element layout process, the elements will automatically from left to right, from the top down the flow arrangement. Out of the flow of the document, that is, the element is removed from the normal layout, and the other boxes are positioned as if the element that is out of the document stream does not exist. If a DIV element A is floating, if the previous element of a element is also floating, then a element will follow the previous element (if the two elements are not placed in a row, the a element will be squeezed to the next line), and if the previous element of a element is an element in the standard flow, the relative vertical position of a will not change. This means that the top of a is always aligned with the bottom of the previous element. In addition, the block element element after the floating box will assume that the box does not exist, but the text in it will still make a position for the element. The inline element after the floating box will be vacated for this box and then sorted in order. Incomplete out-of-document FLOW * * *left and right structure div box overlap phenomenon, is generally due to the adjacent two Div one using floating one does not use floating. One uses the floating one without causing the div not to be on the same "plane", but the content does not cause coverage, only the div forms the overlay phenomenon. Solution: Either do not use float, either use float float, or set the margin style for a div that does not use float floating position positioning and display properties see the next chapter
Action property of CSS style one