Color background CSS

xiaoxiao2021-03-06  67

This chapter is the main role of C s S

After the previous chapter introduces the method and some characteristics of the declaration and application, from this chapter, it is necessary to officially enter the CSS instruction! This chapter has two introductions themes. The first part introduces the color and background-nature CSS, its main role is the nature of the set of the foreground color, background color and background graphics, etc.; Some of the document describes the CSS instructions for controlling the location of the elements.

Color back view C s command

Color Settings Prospect Color

stand by:

IE3, IE4, NC4

Be applicable:

All elements

Possible value:

Set color, please refer to the first chapter color use

default value:

Depending on the browser

Inheritance:

Have

General Example: span {color: blue}

Coaxial example:

Background-color set background color

stand by:

IE4, NC4

Be applicable:

All elements

Possible value:

Setting color, please refer to the related description of the color use of color transparent transparency to the background of the parent element (color or pattern)

default value:

TRANSPARENT

Inheritance:

no

General Example: Body {Background-Color: Blue}

Coaxial example:

Background-Image Setting Background Graphics

stand by:

IE4, NC4

Be applicable:

All elements

Possible value:

Setting the graphics URL, please refer to the first chapter URL representation NONE does not use the background pattern

default value:

TRANSPARENT

Inheritance:

no

General example:

Body {Background-Image: URL ("http:// YourWeb / Path / file_name")}

Coaxial example:

Background-repeat setting background Repeat

stand by:

IE4, NC4

Be applicable:

All elements

Possible value:

Repeat Repeat Background Graphics Fills Page REPEAT-X Horizontal Direction Background Graphics Repeat-Y Vertical Direction Repeat Background Graphic NO-REPEAT Do Not Repeat Background Graphics

default value:

Repeat

Inheritance:

no

General Example: Body {Background-Repeat: Repeat-x}

Coaxial example: Background-attachment setting background attached

stand by:

IE4, NC4

Be applicable:

All elements

Possible value:

Scroll background graphic with the reel rolling fixed background graphic with the reel roller (floating water)

default value:

scrol

Inheritance:

no

General Example: Body {Background-attachment: fixed}

Coaxial example:

Background-position set background location

stand by:

IE4, NC4

Be applicable:

Block element

Possible value:

x% Y% graphics X% Y% point alignment element X% Y% position XY Place the upper left corner of the graphic Left upper horizontal horizontal X Vertical Y CENTER background diagram placed in the center LEFT Background graphic to the left Right background graphic to the right TOP background graphic to top bottom background graphic to the bottom

default value:

0% 0%

Inheritance:

no

General Example: Body {Background- Position: 100% 50%}

Coaxial example:

Background integrated set background nature

stand by:

IE3, IE4, NC4

Be applicable:

All elements

Possible value:

Background-Color Set Background Color Background-Image Setting Background Graphics Background-Repeat Set Background Repeat Background-Attachment Set Background Attach Background-Position Set Background Location

default value:

no

Inheritance:

no

General example:

Body {Blue URL (Image / GIF) REPEAT-X Fixed Center}

Coaxial example:

Position of the C s S command

Float sets floating properties (mostly used for texture)

stand by:

IE4, NC4

Be applicable:

Block elements or graphics

Possible value:

Left elements are left, text around its right Right element, text around its left none in a preset method

default value:

None

Inheritance:

no

General example: div {float: Right}

Coaxial example:

CLEAR sets the clear nature (setting if the floating element is allowed)

stand by:

IE4

Be applicable:

Block elements or graphics

Possible value:

Both If there is a floating element on both sides, the element is moved to the floating element. If there is a floating element on the left, the element is moved to the floating element. If there is a floating element on the right, the element is moved to the floating element NONE to preset Method display

default value:

None

Inheritance:

no

General Example: Div {CLEAR: RIGHT}

Coaxial example:

Width setting width

stand by:

IE4, NC4

Be applicable:

Block elements or graphics

Possible value:

Length unit, please refer to the relevant instructions of the basic unit of the first chapter percentage, the parent element width is the reference auto automatically changes in fixed ratio

default value:

Auto

Inheritance:

no

General example: div {width: 300pt}

Coaxial example:

HEIGHT setting height

stand by:

IE4, NC4

Be applicable:

Block elements or graphics

Possible value:

Length unit, please refer to the relevant instructions of the basic unit of the first chapter percentage, the parent element width is the reference auto automatically changes in fixed ratio

default value:

Auto

Inheritance:

no

General Example: Div {Height: 300pt}

Coaxial example:

Position setting location

stand by:

IE4, NC4

Be applicable:

Block element

Possible value:

Absolute is based on the parent element, and it is averaged in a particular location in a specific location. The static preset position is set at a specific location, and the element is located in the original code.

default value:

Absolute

Inheritance:

no

General Example: DIV {Position: static}

Coaxial example:

TOP setting top position

stand by:

IE4, NC4

Be applicable:

Block element

Possible value:

Length unit, please refer to the relevant instructions of the basic unit of the first chapter percentage, the parent element width is the reference auto display in normal way

default value:

Auto

Inheritance:

no

General example: div {TOP: 30pt}

Coaxial example:

LEFT sets the left end position

stand by:

IE4, NC4

Be applicable:

Block element

Possible value:

Length unit, please refer to the relevant instructions of the basic unit of the first chapter The percentage of the parent element is displayed for the preset value in a normal manner:

Auto

Inheritance:

no

General Example: Div {Left: 30pt}

Coaxial example:

CLIP setting crop (set a region shape and size, outside the area)

stand by:

IE4, NC4

Be applicable:

Block element

Possible value:

RECT (TOP, Right, Bottom, Left) Set the left length of the lower right below the rectangle, which will automatically align the pairs of edges to RECT (0, length, length, 0) cannot be written as REC (0, 0, The length, length) can be "auto" instead of the AUTO display

default value:

Auto

Inheritance:

no

General Example: Div {Clip: Rect (0,100px, 50px, 0)}

Coaxial example:

OVERFLOW Setting the overhead process (Control When the content of the element exceeds the size of the element)

stand by:

IE4

Be applicable:

Block element

Possible value:

The Visible element will not be displayed in the set size display, and you can see that all content Hidden's partial part of the unit will be hidden. Scroll is not necessary. Scroll is necessary. If necessary, the can be allowed to see all of the content auto Preset method display

default value:

Auto

Inheritance:

no

General Example: Div {Overflow: scroll}

Coaxial example:

Visibility Sets the visibility

stand by:

IE4, NC4

Be applicable:

All elements

Possible value:

Visible setting This element shows that Hidden settings that the element is not displayed, but still occupying the space inherit to determine the visibility of the parent element.

default value:

inherit

Inheritance:

no

General Example: Div {Visibility: hidden}

Coaxial example:

Z-index sets z-axis parameters (three degree space)

stand by:

IE4, NC4

Be applicable:

Block element

Possible value:

Ten Give Near Values, the value of the value will appear above the value of small elements. AUTO is repeated when the element position is repeated, and the original code will appear on the back element to be above the front element.

default value:

Auto

Inheritance:

no

General Example: Div {Z-Index: 3}

Coaxial example:

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

New Post(0)
CopyRight © 2020 All Rights Reserved
Processed: 0.048, SQL: 9