Css automatically intercepts strings and is compatible with ie7 ff code

Source: Internet
Author: User

The actual column is as follows:

. Title
{
Width: 200px;
White-space: nowrap;
Word-break: keep-all;
Overflow: hidden;
Text-overflow: ellips tutorial is;
}

Span or div references are available, for example:

<Span class = title> The title displayed on the client is too long. The unused part is omitted and the ellipsis is added. </span>

<Div class = title> the client solves the problem. The title is displayed too long. The unused part is omitted and the ellipsis is added. </div>

The above two examples show that after the PX width of the style definition is exceeded, the subsequent characters will be replaced.


The above is incompatible with ie7 ff. I will make some adjustments below.

<Style type = "text/css tutorial">

<! --

. Div1 {

Width: 200px;

}

. Div1 span {

White-space: nowrap;

Text-overflow: ellipsis;/* for internet explorer */

Overflow: hidden;

Width: 168px;

Display: block;

Float: left;

}


Html> body. div1: after {/* for FF */

Content :"...";

Margin-left: 5px;

}


-->

</Style>


<Div class = "div1"> <span> the compatibility of the Internet Explorer 7 recently released by Microsoft does impose a heavy burden on some page makers </span> </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.