CSS app development more useful CSS properties

Source: Internet
Author: User

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

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.