Introduction: I just into the front-end not long, in the development of the app, often encountered some strange problems, I have less experience, will use JS to solve the problem of CSS, but, but do not know that some CSS has helped us to solve.
1,white-space:nowrap;
| value |
Description |
| Normal |
Default. The blank will be ignored by the browser. |
| Pre |
The blank will be reserved by the browser. It behaves like a <pre> tag in HTML. |
| NoWrap |
The text does not wrap, and the text continues on the same line until the <br> tag is encountered. |
| Pre-wrap |
Preserves the sequence of whitespace characters, but wraps them normally. |
| Pre-line |
Merges a sequence of whitespace characters, but preserves newline characters. |
| Inherit |
Specifies that the value of the White-space property should be inherited from the parent element. |
This property, fixed when we display the data, due to the background data in the space caused by the layout of scattered, or ugly, you can use its properties to ignore the
2,text-overflow:ellipsis;
| |
description |
test |
| clip |
trim text. |
test |
| ellipsis |
|
test |
| string |
|
&NBSP; |
This property is very useful, remember in the development of the app, there are data list display, each data has a picture and text description, but too much text, we do not need so many words, at the beginning, I use JS to control the number of words, but it is not wise ah, but this has the disadvantage is that does not support multi-line pruning.
CSS app development more useful CSS properties