Home > Web Front-end > HTML Tutorial > 【CSS3】-text-overflow 与 word-wrap_html/css_WEB-ITnose

【CSS3】-text-overflow 与 word-wrap_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:45:45
Original
1956 people have browsed it

text-overflow is used to set whether to use an omission mark (...) mark Overflow of text within an object.

Grammar:

But text-overflow is only used to explain how to display text when it overflows. To achieve overflow, is generated For the effect of the ellipsis , you must also define to force the text to be displayed in one line (white-space:nowrap) and overflow content to be hidden (overflow:hidden). Only in this way can it be achieved The overflow text displays the effect of ellipsis , the code is as follows:

text-overflow:ellipsis; //显示省略标记overflow:hidden; //溢出内容为隐藏white-space:nowrap; //强制文本再一行内显示
Copy after login

At the same time, word-wrap can also be used to set Text behavior , whether to break and break when the current line exceeds the boundary of the specified container.

Syntax:

normal is the browser default value, break-word is set in long word or URL address should be wrapped inside. This attribute is not commonly used. Just use the browser default value.

》》》》》》》》》》》》》》 Multi-line text displays the ellipses """""""""""

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template