Summary of common effects of CSS

Source: Internet
Author: User

1, div editable, is to let a div into a similar input box effect.

Adding the Contenteditable= "true" attribute to the DIV is OK, as follows:

< Div contenteditable = "true" ></ Div >  

2. Set color to Input 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}

3, CSS3 implement a DIV set multiple background images and Background-image properties

1 <style>2 #demo{width:370px;Height:95px;background:URL (1.png) no-repeat 0 0,url (2.png) no-repeat 185px 0;}3 </style>4 5 <DivID= "Demo"></Div>

Example Picture:

4. Transparency

<style>. Demo{width:100%;Height:25px;background:Orange;    /*compatible ie6+,chrome,firefox--Note Do not change the order of the following three properties*/Opacity:0.3;-ms-filter:"Progid:DXImageTransform.Microsoft.Alpha (opacity=0)";Filter:Alpha (opacity=30);}</style><Pclass= "Demo">Hello World</P>

5, out of length display ellipsis

1 <style>2 . Demo{3 width:300px;4 Display:Bolck;5 Overflow:Hidden;6 White-space:nowrap;7 Text-overflow:ellipsis;8 }9 </style>Ten  One <Pclass= "Demo">Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world!</P>

6. CSS forced line wrapping and no wrapping

[Transfer from]:http://www.haorooms.com/post/css_common

Summary of common effects of CSS

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.