CSS background transparent: CSS control background

Source: Internet
Author: User
Tags add
The following is the program code


With CSS you can not only change the background of the entire page you can also control
The background of other elements, such as P,div. This section we
The nature of the discussion will be
Color: Colors of text
Background-color: Background color
Background-image: Background Images
Background-repeat: Duplicate background images
Background-attachment: Whether to freeze the background image
The color of the text
We use color to determine the color of the text, the perimeter, and the horizontal line.
P.greentext {Color:green}
Take a look at the example below
The following is the program code


The color of this line of text is green


<TR><TD bgcolor= "#ffffcc" >


Color of the background
Background color can be controlled by background-color, such as we want to call some text paragraph background color for
Light green,
P.GREENBG {background-color: #ccefcc}
Take a look at the example below
The following is the program code

The background color of this line is light green



Image of the background
Not only can we add a background image to the entire page, we can also give it
Add a background image to one of the elements, for example, we give P the background plus the day
An empty background
P.sky {Background-image:url (.. /image/sky.jpg)}
Take a look at the example below
Adding color or image to the background of an element allows us to freely emphasize some of my
The words that we want everyone to notice. And without CSS, we can only change the entire web.
Background color or image of a page
We can not only decide whether to add images to the background, but also to determine whether the
The image repeats and in which direction. For example, we just let the image
Repeat the vertical direction of the entire page and we can get rid of the image bar on the left.
The effect. This article links http://www.cxybl.com/html/wyzz/CSS/20120601/27370.html

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.