CSS3 Text Model

Source: Internet
Author: User

I am a front-end developer, often encounter questions about the text model, many places we often encounter this problem. For example, the title of the column, when the designer gave us the picture does not take into account the length of the title, so we develop ourselves in the process of attention to this point.

First, we will take a look at some basic properties of the text model and then analyze it for some cases.

<text> Model Properties

Property

Describe

Css

Text-overflow

Specifies what happens when the text overflows the containing element

3

Text-fill-color

Specify fill color for text

Text-stroke

To stroke text

Text-stroke-width

To the width of the text stroke

Text-stroke-color

Color for text strokes

Text-shadow

Add a shadow to text

3

Word-break

Rules for line breaks in non-Japanese and Korean texts

3

Word-wrap

Allows splitting of long, indivisible words and wrapping to the next line

3

Text-overflow

Value

Describe

Clip

Build text

Ellipsis

Show ellipsis to represent trimmed text

String

Uses the given string to represent the trimmed text

Case one: Limit the number of words through Overflow:hidden

Show graph above, this way need to limit height and row height, want to control the content in the real scope, so this way is not recommended in the way, there is no use of text model

Case two: through Text-overflow:ellipsis;

This approach is more desired in development projects because he has no requirements for line heights and restricts the behavior of line breaks

CSS3 Text Model

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.