Several tips for dealing with text

Source: Internet
Author: User

Through the CSS can have a good effect on the text. The following is a simple collation of several word processing techniques. Continuously updated.

First, text overflow: text-overflow

The basic specifications are as follows:

1{2  display: block; /* Must be a block-level element */3  white-space: nowrap;  /* No Line break */4  text-overflow: ellipsis;  /* Use ellipsis for overflow */5  overflow: hidden;  /* Do not allow scroll bars */6  width: 100px; /* You must specify a width to know where to truncate the text */78 }

Of course, when you are compatible with older versions of opera don't forget to add prefixes:

-o-text-overflow:ellipsis;

For overflow text, we can also have other processing options:

{   text-overflow:ellipsis;   /* use ellipses to represent overflow */ ;   text-overflow:clip;   /* truncate overflow text */    text-overflow:string;   /* Specify a string to replace the overflow part */ }

Second, the text sub-column: Column-count, Column-gap, Column-rule

We can often see the kind of column layout in the newspaper, in fact, in CSS3 also provides the text to display multiple columns of the properties:

{  -moz-column-count: 3;   -webkit-column-count: 3;   column-count: 3;   -moz-column-gap: 30px;   -webkit-column-gap: 30px;   column-gap: 30px;   -moz-column-rule: 1px dashed black;   -webkit-column-rule: 1px dashed black;   column-rule: 1px dashed black;}

A few tips for working with text

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.