How CSS makes the content out of HTML appear as ellipses

Source: Internet
Author: User

The text exceeds the need to hide and display the ellipsis this is often used in the work, I think a lot of people have come across it, there are two ways to solve
The first, with the program to open the interception of character length, this is actually possible.
The second is to share the content, using CSS style to do, not much to say, directly on the code bar:
Html:
<class= "Css1">Web Front-end development – focus on website front-end design and Web user experience </Div  ><class= "Css2">Web Front-end development – Focus on website front-end design and Web user experience </div>

Css:

. Css1{Color:#6699ff;Border:1px solid #ff8000;Margin-bottom:20px;width:20em;/*semi-kanji truncation is not allowed*/}. Css2{Overflow:Hidden;/*Automatically hide text*/Text-overflow:ellipsis;/*add ellipses after text is hidden*/White-space:nowrap;/*force no Line break*/width:10em;/*semi-kanji truncation is not allowed*/Color:#6699ff;Border:1px solid Red; }

Ok! Thanks for reading!!!


How CSS makes the content out of HTML appear as ellipses

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.