Css tips are constantly updated. css tips are constantly updated.

Source: Internet
Author: User

Css tips are constantly updated. css tips are constantly updated.

1. After removing input and remembering the password, the system automatically fills in the yellow background of the form.

Input:-webkit-autofill {-webkit-box-shadow: 0 0 0px 1000px # FFF inset ;}
// Where # fff is the background color value

2. IE8 does not support the opacity: 0 attribute. You can add the following attribute:

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

3. In the IE input box, remove the cross in the text box and the eye icon in the password input box:

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

4. textarea attributes

Resize: none; // remove the size. Drag outline: none; // remove the yellow border.

5. Make sure that the regular expression is correct.

Regular. test (the val value to be satisfied)

6. Single line text omitted

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

7. When the font-size in the style table is smaller than 12px, the font in the Chinese chrome browser is still 12px, which can be used at this time:

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

8. Do not wrap the xmp labels automatically:

xmp {         whitewhite-space: pre-wrap; /* css-3 */    whitewhite-space: -moz-pre-wrap; /* 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+ */    white-space: pre-wrap; /* Firefox */}

9. Solution for invalid object height 0

Add a div to its outer layer so that the height of the div is 0 or the font-size is 0 <div>10. input box

To eliminate the memory of input, add: autocomplete = "off" in the input box to prevent copying: oncopy = "return false;" oncut = "return false; "unpaste content in input: onpaste =" return false "unselect content in input to prevent copying: <body onselectstart =" return false ">

11. Full Screen mask code segment (fixed is a relative window)

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

12. Differences between display: none and visibility: hidden:

Display: none; not displayed, not occupying space
Visibility: hidden; not displayed, occupying 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.