CSS dynamically controls long string styles on the page

Source: Internet
Author: User
CSS dynamically controls long string styles on the page

During front-end page development, the length of a column in the setting list is often encountered. Such as title and remarks

However, some of them need to dynamically adjust their length based on the width of the entire page. Otherwise, style misplacement may easily cause reading difficulties.

It is a good solution to dynamically control the capture of long strings through CSS attributes. The style settings are as follows:

Style = "text-overflow: ellipsis; white-space: nowrap; overflow: hidden ;"

These three attributes must be combined to achieve the effect!

The style settings are as follows: the first and second rows are appended with the style. The ellipsis is automatically set based on the width of the IE window.

Note: The three styles must be appended. Otherwise, it is invalid.

 

 

 

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.