CSS captures strings in Firefox to display ellipsis

Source: Internet
Author: User

It is a practical function to use CSS to intercept strings and display them as ellipsis. It is used by the CSS front-end for processing to reduce the waste of server resources and make the webpage faster, however, sometimes, due to the compatibility of the browser, the processing methods of CSS string Truncation in IE and Firefox are different.CodeIt solves the problem of CSS string truncation under Firefox.
------------------------------ CSS style -------------------------------------

<Style> <style type = "text/CSS"> <! -- Body {font-family:; font-size: 12px; color: #333333 ;}. div1 {width: 200px ;}. div1 A {white-space: nowrap; text-overflow: ellipsis;/* for Internet Explorer */overflow: hidden; width: 168px; + width: 200px; _ width: 200px; display: block; float: Left;} HTML> body. div1: After {content :"... "; margin-left: 5px;} --> </style>

--------------------------------------- HTML ------------------------

<Div class = "div1"> <a href = "#"> it is a practical function to intercept a string with CSS and display it as a ellipsis, hand the part to the CSS front-end for processing </a> </div>

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.