Common CSS Summary

Source: Internet
Author: User

1, let the website quickly become gray

1 HTML{2 Filter:grayscale (100%);//ie Browser3 -webkit-filter:grayscale (100%);//Google Chrome4 -moz-filter:grayscale (100%);//Firefox5 -ms-filter:grayscale (100%);6 -o-filter:grayscale (100%);7 Filter:progid:DXImageTransform.Microsoft.BasicImage (grayscale=1);8 -webkit-filter:Grayscale (1);//Google Chrome9}

2. Allow Div to be edited like input

1 <DivID= "Test"contenteditable= "true"  ></Div>  2 3 <DivID= "Test1"contenteditable= "true" ></Div>  4 5  <DivID= "Test2"contenteditable= "true"></Div> 

Compatibility such as:

3. Let Div prohibit the selection

1 <  unselectable= "on"  onselectstart= "return false;" > 2 Try and see if you can choose 3 </ Div >

4. Setting Properties for Placeholder

1 ::-webkit-input-placeholder{/*WebKit Browsers*/2 Color:#999;3}4 :-moz-placeholder{/*Mozilla Firefox 4 to*/5 Color:#999;6}7 ::-moz-placeholder{/*Mozilla Firefox 19+*/8 Color:#999;9}Ten :-ms-input-placeholder{/*Internet Explorer + +*/ One Color:#999; A}

5. Clear Floating

1 . Clearfix:after {Display:block; Visibility:hidden; Clear:both; height:0; content:'. '; font-size:0}

6, text overflow display ellipsis

1 {display:bolck;  Overflow:hidden; white-space:nowrap; text-overflow:ellipsis;}

7. Forced line break

1 //Automatic line wrapping2 3 Div{4 Word-wrap:Break-word;5 Word-break:Normal;6}7 8 //Force English words to break9 Ten Div{ One Word-break:Break-all; A} -  - //Force No Line break the  - Div{ - White-space:nowrap; -}

Ps: Not to Be continued ~

Common CSS Summary

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.