12 CSS Tips you have to know

Source: Internet
Author: User
Tags regular expression visibility

1, remove input remember the password automatically fill out the yellow background of the form

Input:-webkit-autofill {-webkit-box-shadow:000px1000px#fffinset; }
Where #fff is the background color value

2, IE8 does not support the Opacity:0 property, you can add the following properties:

Filter:progid:DXImageTransform.Microsoft.Alpha (opacity=0);

3, IE input box to remove the text box fork and password input box eye icon:

::-ms-clear,::-ms-reveal{display:none;}

4, TextArea property

Resize:none; Remove Size Drag
Outline:none; Remove yellow border

5, to determine whether the regular expression to meet the correct way of writing

Regular. Test (the Val value to be satisfied)

6. Single-line text omitted

Overflow:hidden;text-overflow:ellipsis;white-space:nowrap;

7, when the style table font-size less than 12px, the Chinese version of the Chrome browser font is still 12px, you can use:

Html{-webkit-text-size-adjust:none;}

8, the resolution XMP label does not automatically wrap:

XMP {    
    whitewhit e-space:pre-wrap;/* css-3 * *
    whitewhite-space:-MOZ-PRE-WR ap;/* Mozilla, since 1999 * *
    whitewhite-space:-pre-wrap;/* Opera 4-6 * *
    whitewhite-space:-o-pre-wrap;/* Opera 7 * *
    word-wrap:break-word;/* Internet Explorer 5.5+ * /div>
    white-space:pre-wrap;/* Firefox */
}

9, the object height is 0 not effective solution

Add a div to the outer layer so that the div's height is 0, or font-size is 0.

<divstyle= "height:0" >
<objectobjectwidth= "0" height= "0" ></object>
</div>

10, the input box

Eliminate the memory function of input: In the input box add: autocomplete= "Off"
Input content to prevent replication: oncopy= "return false;" oncut= "return false;"
Content in input to be onpaste=: "Return False"
Content in input deselect, prevent replication: <body onselectstart= "return false" >

11. Full Screen Mask code segment (Fixed is relative window)

<divclass= "Mask" ></div>
. mask{position:fixed;top:0;left:0;width:100%;height:100%;z-index:999;}

12, the difference between Display:none and Visibility:hidden:

Display:none; Do not show, do not occupy space
Visibility:hidden; Do not show, Occupy space

Related Article

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.