Make CSS more efficient

Source: Internet
Author: User
Hexadecimal color value pairs

The default hexadecimal color value is uppercase and six-digit. Lower rendering efficiency without taking risks in unknown situations.
  • Disapproval-color:#f3a;
  • Recommended-color:#FF33AA;
Differences between display and visibility

Display hidden objects do not retain physical space, and visibility is the physical space occupied by hidden objects. Resources are consumed when the browser renders the occupied physical space.
  • Disapproval-visibility:hidden;
  • Recommended-display:none;

 

Difference between border: none; and border: 0;

Border: 0; although the border can be hidden, it will reserve the right to use border-color/border-style for you.
  • Disapproval-border:0;
  • Recommended-border:none;
  The background image must not be too small.  
Although the file size is very small, a background image with a width and a height of 1 px needs to be tiled for 2500 times.
  Disagree With * {margin: 0; padding: 0;} to avoid Browser style differences  
  • No. wildcard * is used.
  • Disagree. tags such as div span button B table include wildcards to control internal and external filling styles.
  • We recommend that you use wildcards to control the internal and external fill styles.
* The wildcard number initializes all the labels, and the rendering of the browser consumes a certain amount of resources.
  Do not use the label name or class to describe the ID or class.  
ID and class are unique and unnecessary.
  • Difference-input # data1 {}
  • Good-# data1 {}
 
  • Difference-input. class1 {}
  • Good-. class {}
  Avoid descendant Selection Characters  
  • Difference-treehead treerow treecell { }
  • Better-treehead > treerow > treecell { }
  • Good-.treecell-header { }

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.