Review the background and text style of CSS

Source: Internet
Author: User

CSS background style:

①. Use keywords to set values: center, top, bottom, left, right, for example, background-position: top;

②. Use percentage to set the value, for example, background-position: 50%. This mode is complex. The default value of background-position is 0%, which is equivalent to top left; if you want to place an image at 2/3 in the horizontal direction and 1/3 in the vertical direction, you can declare it as follows:

{:;:;:;  }

③ Use the length value to set the value. The length value refers to the offset in the upper left corner of the element's padding area. The offset is the upper left corner of the image.

{:;:;:;  }

CSSText style:

Text properties allow you to change the color, spacing, alignment style, decoration text, and indentation of text.

The text-indent attribute can also use negative values, but be careful when setting negative values for text-indent. If a negative value is set for a paragraph, some text in the first line may exceed the left border of the browser window. To avoid this problem, we recommend that you set another margin or some padding for negative indentation: p {text-indent:-5em; padding-left: 5em ;};

The text-indent attribute is expressed by percentage, which is the width of the percentage relative to the parent element of the indent element. In other words, if the indent value is set to 5%, the first line of the affected element is indented to 5% of the width of its parent element.

 

2. Text alignment:The text-align attribute is used to set the text alignment of an element.

{:;        }{:;        }{:;        }{:;        }

3.Text Spacing:The letter-spacing attribute can change the standard spacing between texts. The default value is normal, which is equivalent to 0. The letter-spacing attribute accepts a positive or negative length value. If a positive length value is provided, the interval between words increases. Setting a negative value for letter-spacing will bring it closer:

{:;        }{:;        }

4.Spacing between rows:Use the line-height attribute to set the line spacing (Row height). The default value is normal. Set the percentage. Set the line spacing based on the percentage of the current font size. Set the number, the line spacing is equal to the number multiplied by the value of the current font size. The length is set to a fixed line spacing. The setting of inherit specifies that the value of the line-height attribute should be inherited from the parent element.

 

5.Character conversion:Use the text-transform attribute to process the case of text. The default value is none. It is displayed as standard text without any conversion.

{                    :;                }{                    :;                }{                    :;                }

6.Text modifier:Use the text-decoration attribute to modify the text. The default value is none without any modification.

{                    :;                }{                    :;                }{                    :;                }{                    :;                }{                    :;

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.