Do not have any effect: A:link{text-decoration:none}Word spacing:
You can adjust the distance between words by using the character spacing attribute word-spacing.
Letter spacing:Using the letter spacing attribute letter-spacing, you can adjust the distance between each letter in a word.
- h2 {LETTER-SPACING:10PT};
Row Height:Different from the kerning is the line spacing line-height, which adjusts the vertical distance between rows and lines, and has three ways to set:
- Value: h3 {font-size:12pt; line-height:2};/* here line-height=2x12pt=24pt * *
- Length unit: h3 {font-size:12pt; line-height:24pt};
- Ratio: h3 {font-size:12pt; line-height:200%};
Either the kerning or the letter spacing or line spacing has a common parameter: normal, once you set it to normal, you want the browser to use the default value.
Horizontal alignment:
You can control the horizontal alignment of a paragraph by using the text alignment attribute Text-align:
- h2 {Text-align:center}
- h2 {Text-align:left}
- h2 {Text-align:right}
This property can be used for <P>,
Vertical alignment:
With the vertical alignment attribute vwrtical-align, you can control the vertical position of the object (including text or graphics) relative to the parent:
- h2 {Vertical-align:top}
- h2 {Vertical-align:text-top}
- h2 {Vertical-align:bottom}
- h2 {Vertical-align:text-bottom}
- h2 {Vertical-align:baseline}
- h2 {Vertical-align:middle}
- H2 {vertical-align:sub}/* Superscript * *
- H2 {vertical-align:super}/* Subscript * *
These properties of the specific alignment effect, I hope we have to test themselves.
First Line indent:
First line indent text-indent, often used in document typesetting:
- h3 {text-indent:24pt};the concept of a container:
According to the CSS on the page style definition, all the elements on the page are placed in a container, this container is called box. Box also includes:
- element itself;
- Spaces around the element; (padding)
- A bounding rectangle around the element's space; (border)
- The margin outside the border. (margin)
Four margins:Margin is used to set up, right, down, left, margin:
- Body {margin-top:10px;margin-right:20px;margin-bottom:30px;margin-left:40px}
- The body {margin:10px 20px 30px 40px}/* effect is the same as the above mode * *
The above parameter values can also be other length units (such as: Pt,em, etc.) or proportions.
Top, bottom, left, right space padding:
Padding is used to set the space padding range, which is the same as the margin property:
- h3 {margin-top:10px;margin-right:20px;margin-bottom:30px;margin-
left:40px};
- h3 {margin:10px 20px 30px 40px}
border:Border can be set a number of properties, including color and width, the key is to specify the width of each side and the color of each side.
- The border width border-width can be thin,medium,thick or length values:
- h3 {border-top-width:2px;border-right-width:4px;border-bottom-width:6px;border-left-width:8px};
- h3 {border-width:2px 4px 6px 8px}/* is the same as above * *
- P {border-top-width:thin;border-right-width:medium;border-bottom-
Width:thick;border-left-width:none};
- p {Border-width:thin medium thick none}/* is the same as above, the left box will not show * *
- Border color Border-color definition methods are similar to width definitions, and color values can also be in RGB values (such as #ff00ff):
- h3 {border-color:red Blue yellow green}/*: red; right: blue; under: yellow; Left: Green *
- h3 {border-color:red Blue}/*, down: red; right, left: blue;
- h3 {border-color: #ff00ff}/* all borders are #ff00ff color * *
- The line style border-style of the border line, with nine keywords to describe:
- None//does not draw a border, regardless of the thickness of the border * *
- Dotted/* dotted line with dots/*
- Dash/* Dotted line with dash * *
- Solid/* Solid Line * *
- Double/Dual Solid line * *
- Groove/*3d Groove Form * *
- Ridge/*3d Ridge Form * *
- Inset/*3d Inline * *
- Outset/*3D outer inlay * *
The method is similar to the thickness and color, and is no longer spoken.
- The color, thickness, and line style of a border can be defined in a single statement. Cases:
- H1 {border-top:5px solid red}
So many parameters, so many combinations, to be handy, not a few kungfu to practice is impossible to achieve.
Background color:
Background-color, with which you can specify the background color of the entire page, or a single word. In traditional HTML, it's a hassle to apply a background color to a piece of text, to put text in a table and then set the background of the table. CSS makes it very easy.
P.colorback {background-color: #ff0000}
The color can be a color name (such as red), a hexadecimal number (such as #ff0000), an RGB value (such as RGB (255,0,0)).
background Picture:
Background-image, which can be used to specify the background picture of the entire page (put it inside the body tag), or it can be a single word.
- Background-repeat whether to cycle the background
- P {background-repeat:no-repeat;background-image:url (background.gif)}/* does not cycle * *
- P {background-repeat:repeat;background-image:url (background.gif)}/* Cycle * *
- Background-attachment whether the background is fixed
- Body {background-attachment:scroll;background-image:url (background.gif)}/* scrolling with text * *
- Body {background-attachment:fixed;background-image:url (background.gif)}/* Fixed not move *
P.colorback {background-color: #ff0000}
The color can be a color name (such as red), a hexadecimal number (such as #ff0000), an RGB value (such as RGB (255,0,0)).
Background positioning:
Background-position is used to set the location of the background:
- P {background-position:top;background-image:url (background.gif)};
Background-position its parameters can be keywords, length, scale values.
- keywords;
- Top//Background image aligned with foreground object
- Bottom/* Background image is aligned to the bottom of the foreground object * *
- Left//Background image is aligned to the right of the foreground object * *
- Right//Background image aligned with foreground object
- Center/* With any of the previous four combinations, into horizontal or vertical center * *
- Length number;
- Can be any of the previously learned length units (Pt,px,ems ...), for example:
p{background-position:100px 50px;
Background-image:url (Background.gif)} represents a level of 100 pixels from the top left corner and a vertical 50 pixel position.
- Proportional value;
- For example: p{background-position:85% 50%;
Background-image:url (Background.gif)}
Represents the position from the right 85% of the distance paragraph, and the vertical distance from the top 50% of the paragraph.