Using CSS to realize the automatic hiding of text

Source: Internet
Author: User
Tags inheritance
CSS not wrapped <NOBR></NOBR> (no line wrap)

Overflow
Version: CSS2 compatibility: ie4+ ns6+ Inheritance: None

Grammar:

overflow:visible| Auto| Hidden| Scroll

Parameters:

Visible:does not cut content nor does it add scroll bars. If you explicitly declare this default value, the object will be clipped to the size of the window or frame that contains the object. and the Clip property setting will fail
Auto:This is the default value for the body object and textarea. Cut content and add scroll bars when needed
Hidden:Do not display content that exceeds the size of the object
Scroll:Always show scroll bars

Description

Retrieves or sets how content is managed when the content of the object exceeds its specified height and width.
Setting the TextArea object to the hidden value hides its scroll bar.
For table, if the Table-layout property is set to fixed, the TD object supports the overflow property with the default value of hidden. If set to Hidden,scroll or auto, the content that exceeds TD size will be cut. If set to visible, it causes extra text to overflow to the right or left (depending on the direction property setting) cell.
This property is available on the Mac platform since IE5 started.
The corresponding script attribute is overflow.
Example:

Body { Overflow: Hidden; }
div { Overflow: scroll; height:100px; width:100px; }

Text-overflowVersion: ie6+ proprietary attribute inheritance: None

Grammar:

text-overflow : Clip| ellipsis

Parameters:

Clip:Do not show ellipsis (...). ), but simply cut
ellipsis:Displays an ellipsis (...) when text overflows inside an object. )

Description

Sets or retrieves whether an ellipsis (...) is used. ) to indicate an overflow of text within an object.
The corresponding script attribute is Textoverflow。 Please refer to other bibliographies I have written.

Example:

div { Text-overflow: clip; }

Code:
<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en"
"Http://www.w3.org/TR/html4/loose.dtd" >
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<title> Untitled Document </title>
<body>
<table width= "100%" border= "1" cellspacing= "2" cellpadding= "2" style= "table-layout:fixed" >
<tr>
&LT;TD width= "10%" >s</td>
<td><div style= "width:60%; Overflow:hidden;text-overflow:ellipsis "> <nobr> Asdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff Fffffffffffffffffffffffffffffffffdata goes here </nobr></div></td>
&LT;TD width= "30%" > </td>
</tr>
<tr>
<td>d</td>
<td><div style= "width:60%; Overflow:hidden;text-overflow:ellipsis "> <nobr> Asdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff Fffffffffffffffffffffffffffffffffffdata goes here </nobr></div></td>
<td> </td>
</tr>
</table>
</body>

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.