CSS text shows the remaining ellipses in two lines

Source: Internet
Author: User

<! DOCTYPE html>

<meta charset= "UTF-8" >

<title>Document</title>

<style>

. comment_inner{

width:200px;

word-break:break-all;

text-overflow:ellipsis;

display:-webkit-box; the/** object is displayed as a telescopic box model **/

-webkit-box-orient:vertical; /** Sets or retrieves the arrangement of child elements of a telescopic box object **/

-webkit-line-clamp:3; /** the number of rows displayed **/

overflow:hidden; /** hide out of content **/

}

</style>

<body>

<div>

<p>

The Word-break property specifies how the Wrap is Handled. Normal (use the Browser's default line-wrapping rule.) ), Break-all (allows Line wrapping within a word.) ), Keep-all (can only wrap at half-width spaces or hyphens.) )

</p>

</div>

</body>

Generally used in a row.

1.overflow:hidden;
2.text-overflow:ellipsis;
3.-o-text-overflow:ellipsis;
4.white-space:nowrap;
5.width:100%;
Among them, Overflow:hidden and White-space:nowrap are necessary, otherwise the ellipsis will not be displayed;-o-text-overflow:ellipsis is for opera, and the width is set mainly for IE6;
This method supports Internet Explorer, Safari, Chrome, and Opera, but FF does not support it, but it can be done with jquery for similar effects.

CSS text shows the remaining ellipses in two lines

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.