CSS style Background and text

Source: Internet
Author: User
Tags processing text
CSS style Background, text 1, Background

1. background-color attribute is used for background color, for example, body {background-color: red}

2. Use the background-image attribute as the background for the image, for example, body {background-image: ul1(23.jpg)

3. the backgroud-repeat attribute is used to repeatedly tile the background. repeat-x or repeat-y indicates horizontal or vertical tile, respectively,

No-repeat indicates that tile is allowed in any direction.

Example: body

{Background-image: url(23.jpg)

Background-repeat: repeat-x :)}

4. Use the background-position attribute to locate the background. [location: top, bottom, left, right, center, and can also be used.

Percentage (50% 50%), length value (50px 50px)]

Example: body

{Background-image: url(23.jpg)

Background-position: center}

5. Set the image association attribute to use background-attachment. For example, the following image background does not scroll with the text.

Body {background-image: url(23.jpg );

Background-repeat: no-repeat;

Background-attachment: fixed ;}

Ii. Text

1. indent text with the text-indent attribute. The most common is the indent of the first line of the paragraph. The indent value can be negative.

For example: p {text-indent:-5em}, but setting a negative number may easily exceed the left border of the browser window;

The unit of indentation value can be %, the unit of length is px, and the unit of measurement is em;

The text-indent attribute can be inherited, for example:

P # outer {width: 500px ;}

P # inter {text-indent: 10%}

P {width: 200px ;}

Some text.

This is a pragramph

2. Use the text-align attribute (left, right, center, and justity) for horizontal alignment)

3. word-spacing can change the standard interval between words (words). The default value is normal and the value is set to 0,

Word-spacing can accept positive or negative length values.

4. letter-spacing changes the spacing between characters and letters. The other values are the same as word-spacing. The default value is normal and the default value is 0.

Accept positive and negative length values.

5. text-transform processes text in case (none, uppercase, lowercase, and capitalize ).

Write

6. text-decoration processing text decoration (none, underline, overline, line-through, blink flash)

Bytes

7. Process white-space characters

Value pre-line, blank space character: merged, line feed: retained, automatic line feed: allowed;

Value: normal, blank space: merged, line break: ignored, automatic line feed: allowed;

Value: nowrap, blank space character: merged, line feed: retained, automatic line feed: Not Allowed

Value pre-wrap, blank space character: retained, line feed: retained, automatic line feed: allowed

8. The direction attribute affects the writing direction of the text in the block-level element. The layout direction and content level in the list fill in the direction of the text box

And the position of the last line in the alignment element at both ends (two values are available, ltr and GPS. The default value is ltr, which is the left-to-right direction)

9. Set line-height to the row height.

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.