CSS Grammar Manual (v) color and background properties

Source: Internet
Author: User
Tags manual
css| Syntax

1, color

function : Sets the color of the foreground or element.
numeric value: Use a color keyword or an RGB value.
Example :

Text color (keyword)

Text color (#rrggbb)

Text color [RGB (RR,GG,BB)]

Text color [RGB (r%,g%,b%)]

2, Background-color

features : Sets the background color of a page or page element.
value :
Colors-Available color names or RGB values
Transparent-transparent, making the page background the default background.
Example :

Background color

3, Background-image

function : Defines a background graphic.
value :
None-Background without graphics
URL-provides the URL address of the graphics file
Note : You can also include the Background-color property so that you cannot find a graphic age with
Example :

Graphics Background

4, Background-repeat

function : Controls whether the graphics background is repeated.
value :
Repeat-vertical and horizontal repeat, default value
Repeat-x-Horizontal Repeat
Repeat-y-Vertical Repeat
No-repeat-No repetition
Description : This property is used in conjunction with the Background-image and Background-position properties.
Example :

Horizontal repeat arrangement

5, Background-attachment

function : Specifies whether the background of the element is scrolled along with the element or fixed at a certain point in the page.
value :
Scroll-scrolling along with elements
Fixed-fix
Description :
The default value is scroll, which is used in conjunction with the Background-image property.

6, Background-position

features : used to position element backgrounds in space
value :
Length-the relative or absolute unit sets the starting point of the edge of the element box and gives the coordinates under the unit.
Percent-represents the position of the browser on the edge of the box at the beginning of the drawing. Can repeat this value also provides vertical and horizontal starting point
Vertical position-Sets the starting point of the vertical direction, the keyword is top, center, bottom
Horizontal position-Set the horizontal direction of the starting point, the key left, center, right
For example, the top left, and 0% 0% all indicate that the upper left-hand corner of the graphic begins at the upper-left corner of the element box
Example :

Body {background-image:url (logo.gif); background-position:50% 50%}

This statement sets the body base class to the background graphic to be centered on the page.

7, background

function : Shorthand property, you can set all background properties.
value :
Background-attachment
Background-color
Background-image
Background-position
Background-repeat
For details on the above values, see the Properties section.







Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.