CSS force-wrap several methods (1/3)

Source: Internet
Author: User
Tags object model

I. white-space

You can implement the pre-label effect in html and the nowrap effect of cells. Click here to view the example.

Example source code [www.111cn.net]
Syntax:
White-space: normal | pre | nowrap
Valid value:
Normal: default value. The default processing method. Text automatically processes line breaks. If the container boundary content arrives, it will go to the next line.
Pre: line breaks and other blank characters are protected. This value must be ie6 + OR! Doctype is declared as standards-compliant mode. If! The doctype declaration is not specified as standards-compliant mode. This attribute can be used but does not work. The result is equivalent to normal. See pre object
Nowrap: forces all text to be displayed in the same row until the text ends or the br object is encountered. See nowrap attributes

Note:
Sets or retrieves the processing method of space characters in an object.
Blank space characters, such as line breaks, spaces, and tabs, are ignored by default in html documents. When this attribute is set to normal or nowrap, you can add spaces by using a named entity that does not wrap spaces, and use the br element to add line breaks. This attribute has the same impact on the content you operate on using the Document Object Model (dom) as on the content displayed on ie.
This attribute acts on block objects.

Related styles:
Text-overflow
If you use it with white-space, you do not need to write a program to judge the string length. Click here to view the example.

Example source code [www.111cn.net]
Syntax:
Text-overflow: clip | ellips tutorial is
Valid value:
Clip: default value. The omitted mark (…) is not displayed (...), But simple cropping.
Ellipsis: when the object text overflows, the omission mark (…) is displayed (...)

Note:
Set or retrieve whether to use an omitted flag (...) Indicates the overflow of text in the object.
This attribute only applies to the horizontal inline direction, and the general Western text overflows. Inline overflow occurs when the text in the row exceeds the available width but there is no chance of line feed.
To force overflow and apply the ellipsis value, the author must set the white-space attribute value of the object to nowrap.
If there is no chance of wrapping a line (for example, the width of the object container is narrow, and there is a long text with no reasonable broken lines in it), nowrap may also overflow if it is not applied.
To apply the ellipsis value, this attribute must be set to an object with an invisible area. The best choice is to set the overflow attribute to hidden. When the overflow attribute is set to scroll or auto, this attribute will also be applied. However, a scroll bar appears.
By selecting the omitted mark, you can select hidden text. When this option is selected, the omitted flag is hidden and replaced by text.
This attribute provides an efficient way to create an omitted tag in dhtml.

 

Homepage 1 2 3 Last page
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.