CSS properties (color background properties)

Source: Internet
Author: User
Tags define
CSS 2, color and background properties

You don't want your page to be in a black-and-white world. Would it be better to add color to the text defined by the <font> attribute?

Now let's talk about the color and background properties of the CSS. Let's take a look at the colors and backgrounds under the CSS what are the properties of it (the following table):

Let's give an example. For example, the "LEAF" font mentioned in the previous section, where we add the color attributes, add the following code in <style>:
Color:rgb (204,82,28);
Background-img:url (ss01038.jpg);
Background-repeat:no-repeat;margin-right:15em

* Set the foreground color of the RGB value (204,82,28), you can also use the English name of the color directly defined;
Sets the address of the background pattern, sets the background pattern to not repeat, and also sets the margin margin property
We'll talk about this later, *//.

After adding the code, the "Leaf" font is displayed in this way (pictured below):

How, is not more beautiful than the definition of <font> attributes alone. Of course you can also easily define the background property (like defining the Font property), and let me tell you the writing format for the Background property:

Properties: Background Property value: <background-color>| |     <background-image>| | <background-repeat>| | <background-attacement>| | <background-position>

That is, you can use the Background property to define all of the previously mentioned properties for the background, including background color, background pattern, and so on. Therefore, the code that defines the background in the "leaf" color attribute above can be written like this: "Background:url (ss01038.jpg) no-reapeat"

Well, as for the features of color and background properties, you can try it yourself. In the next section, we'll introduce the text properties of the CSS.







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.