CSS3 How to implement an ellipsis display effect beyond the specified text

Source: Internet
Author: User

Not to do the front-end for a long time, today from the refactoring to understand that CSS3 has been able to achieve a lot of the past must be achieved through JS, such as gradients, shadows, automatic truncation of text display ellipsis and other powerful effects, and these features are maturing, has been used in a large number of production environments. The H5 is really maturing, and has to be made up of evil.

The following share implements the demo of the specified text beyond the ellipsis display:

<style>. Text1 {Width200px;Overflow:hidden;Text-overflow:ellipsis;-o-text-overflow:ellipsis;-webkit-text-overflow:ellipsis;-moz-text-overflow:ellipsis;White-space:nowrap;}. text2 {Width200px;Word-break:break-all;Display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;Overflow:hidden;}</style><Div Class="Text1"> Hot Picks: From sub-channel (Dress shoes bag, parent-child, home, Beauty) in the selection, the inventory of more than 30% of the high-priced products list, the number of 50</Div><BR     />  <div     class = "Text2"  > Hot Picks: From sub-channel (Apparel shoes bag, parent-child, home, Beauty) in the selection, the inventory is more than 30% of the high price of the product list, the number of 50 << Span class= "sy0" >/div    >          

Such as:

Article Share from PHP Chinese web, original address: http://www.php.cn/css-tutorial-360314.html

CSS3 How to implement an ellipsis display effect beyond the specified 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.