Home  >  Article  >  Web Front-end  >  Issues with CSS controlling text automatic line wrapping_Experience exchange

Issues with CSS controlling text automatic line wrapping_Experience exchange

WBOY
WBOYOriginal
2016-05-16 12:08:021400browse

When using tables for web page layout, they can generally be used normally. Sometimes we encounter a phenomenon where a continuous English word or a bunch of exclamation marks (!!!) stretch the web page: (

To summarize, as long as the following sentences are defined in CSS, the web page can be protected. It will not be stretched again.

table{table-layout: fixed;}
td(word-break: break-all; word-wrap:break-word;)

Comments:

1. The first table{table-layout: fixed;}, this style allows the table to automatically wrap when there are characters such as!!! (exclamation point).
2.td{word-break: break-all}, generally it is OK to use this sentence, but in some special circumstances it will still break, so you need to add the following sentence (word-wrap: break-word; ) can be solved. This style can make some consecutive English words in the table automatically wrap.

Statement:
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