Sunday, October 24, 2010

Out errors to make your writing more efficient CSS



According to some CSS experience in writing, how to improve rendering efficiency and consumption of resources by occupation, we come to look at CSS rendering of the efficiency of writing efficient CSS.

1, hexadecimal color value of the median and the case

Write hex color value you may use lower-case letters or omitted into 3-digit, no wording on it to find concrete data to prove the efficiency of the browser's rendering is affected, but the hexadecimal value of the default standard color is capitalized and 6-digit mark. In unknown circumstances, do not want to risk the lower the efficiency of rendering.

* Do not agree-color: # f3a;

* Suggested-color: # FF33AA;

2, display the differences with the visibility

They are used to set or retrieve the display object. display hidden object does not retain the physical space, visibility reserved for the hidden objects occupy the physical space. When the browser rendering of physical space to be occupied, there will be consumption of resources.

* Do not agree-visibility: hidden;

* To use the-display: none;

3, border: none; and border: 0; the difference between

And display a similar relationship with the visibility were not retained and reserved space. More of a border: 0; despite the border to hide out, but it will for you to retain the right to use border-color/border-style.

* Do not agree-border: 0;

* To use the-border: none;

4, should not be too small background image tile

A background image 1px wide and high, although the file size is very small, rendering high-500px wide plate need to repeat the tile 2500. Improve the efficiency of the background image rendering with the image size and volume, and the maximum image file size for about 70KB.

* Do not agree - Wide high 8px below the background image tile

* The proposed use - medium size and measure the background image size

5, IE filter

IE filter in addition to consumption of resources has more compatibility issues. Among them, to make a transparent PNG filter, GIF or JPG can be used through non-transparent approach seems to avoid the use of this filter. Proposed that only a transparent GIF in IE6 applications, because IE7 has support PNG transparency above.

* Do not agree, abuse of consumption of resources as IE filters also have compatibility problems.

* To use, the best choice to use other methods to avoid filters.

6, * (margin: 0; padding: 0;) to avoid differences in browser style

* Is wildcard for all tags are initialized again, the browser's rendering consumes certain resources. Some of the label in the different browsers is almost no difference, or some have been deprecated tag (because you do not use it), they do not need to re-initialize the wildcard again this can save a little resources.

* Do not support the use of wildcard asterisk

* Do not agree, divspanbuttonbtable tag into a wildcard such as internal and external control of fill styles

* To use, to selectively control the use of wildcards within and outside the fill style.

7, do not add additional labels to describe the class or id

If you have a selector based on id as the key selector, do not add the extra tag name up. Because the ID is the only, do not exist for a reason not reduce the efficiency of matching.

* Do not agree-button # backButton ()

* Does not support -. menu-left # newMenuIcon ()

* Suggested - # backButton ()

* Suggested - # newMenuIcon ()

8, try to choose the most specific class to hold the selector

Reduce the efficiency of the system one of the largest class in the label because we used too much of the selector. By adding a class to the elements, we can be subdivided into categories of class type, so no need to waste time on a label too many choices to meet the match.

* Do not agree-treeitem [mailfolder = "true"]> treerow> treecell ()

* Suggested -. treecell-mailfolder ()

9, to avoid children and grandchildren selector

Children CSS selector is the most consumed resources selector. He is very resource intensive, especially in the tag selector to use when the class or general class. In many cases, we really want is the child selector. Unless clearly stated, is strictly prohibited in UICSS descendants selector of.

* Do not agree-treeheadtreerowtreecell ()

* Better, but still not work (see next)-treehead> treerow> treecell ()

10, the label should not contain sub-class selectors

Do not use the sub-tag class selectors. Otherwise, each element in the emergence of an additional increase would match the time. (Especially when the selector seems to mostly be matched case)

* Do not agree-treehead> treerow> treecell ()

* Suggested -. treecell-header ()

11, note the use of all child selector

Careful use of child selector. If you can not think of a way to use him, then do not use. Especially in the RDF tree and the menu will often use child selectors, like this.

* Do not agree-treeitem [IsImapServer = "true"]> treerow>. Tree-folderpane-icon ()

Remember RDF properties can be copied in the template! Advantage of this, we can copy those who want to change the child based on the attributes of RDF XUL element attributes.

* Suggested -. tree-folderpane-icon [IsImapServer = "true"] ()







Recommended links:



PIMS And Calendars comparison



My FAVORITE Anti-Spam And Anti-Spy Tools



Sun executives hefty pay increase for 2006, six times the most high



Come together 3DMeNow! (1)



3GP to MPEG



Bee notes ongoing expert special offers



Should give PRIORITY to social identity verification



VOB to SWF



Automatically change the control once and for all so that the size of VB



STORAGE Timers And Time Synch



How to draw UML activity diagram



FLV To Zune



Picked Games Kids



Modern computer technology



For the B / S structure, to understand the point



12 comments:

  1. Tygart is supposed to be a neutral party but his lust for the scalp of
    icon Pacquiao has overcome his objectivity. By doing this,
    you are allowing yourself to get what you want as you want it.
    Be prepared to go on a series of good and bad dates before finding a potential mate.



    my web site; The Tao of Badass

    ReplyDelete
  2. White and Red WinesWhite wines are made by the liver.
    Acai Berry Extract an impactful natural antioxidant that reduces CDV health risks Resveratrol multi-purpose
    compound, with cancer prevention and high in fat and cholesterol,
    both of which impact cardiovascular disease.
    You should follow daily serving sizes as directed by your
    physician as is best for you.

    my blog post :: triactolexposed.com

    ReplyDelete
  3. In general, pregnancy is a time for many delicious
    juices and refreshing drinks. Even when they
    are trying to quit you'll need to do is know your curative history. breast actives has become more popular due to its powerful effect.

    Feel free to visit my blog post: Breast actives ingredients

    ReplyDelete
  4. Examples of NO topical gels are maxoderm HFR by the necessitous, Spell people wish pregnant women,
    sick, travelers can libertine combining weight
    phone number of years afterward. static surrounded by crumbling metropolis walls and tierce surviving Gates, the vibrant, been in Capital of Kuwait during the Holy place month
    of Ramadan.

    My site maxoderm cream reviews

    ReplyDelete
  5. Yeastrols are fungal inflammations says that condemnable charges against 11 masses who allegedly conspired Together to perpetrate faker in the insurance subject area.
    So I gave

    my blog post ... site

    ReplyDelete
  6. Stoecker came forward with her harassment slim hoodia gordonii 800 mg allegations, and persuaded Ms.
    They explain that there are good carbs and bad carbs.
    But spotting someone who smokes crack or meth will show a difference
    for a few sessions of following along. Scientists
    were able to determine the cause and effect relationship between the use of
    Cool Sculpting. And what escape slim hoodia gordonii 800
    mg do many people run to?

    Feel free to visit my site Hoodia Chaser

    ReplyDelete
  7. This is really interesting, You are a very skilled blogger.
    I have joined your rss feed and look forward to seeking more of your excellent post.
    Also, I have shared your site in my social networks!


    Feel free to visit my blog - Nike Free Sko - -

    ReplyDelete
  8. I am extremely impressed together with your writing skills and also with the layout on your weblog.

    Is this a paid subject or did you modify it yourself? Anyway stay up the nice high quality writing, it's uncommon to peer a great weblog like this one these days..

    Stop by my weblog: Christian Louboutin Outlet :: ngosummit.com ::

    ReplyDelete
  9. Hi there all, here every person is sharing these familiarity, thus it's fastidious to read this website, and I used to visit this blog all the time.

    Also visit my web blog - Cheap NFL Jerseys

    ReplyDelete
  10. I am curious to find out what blog platform you're working with? I'm
    experiencing some minor security issues with my latest blog and I'd like to find something more safe. Do you have any suggestions?

    Also visit my homepage: Nike Free 3.0

    ReplyDelete
  11. It's very effortless to find out any topic on web as compared to books, as I found this post at this web site.

    my web blog ... Air Max

    ReplyDelete
  12. Amazing blog! Is your theme custom made or did you download it from somewhere?
    A design like yours with a few simple tweeks would
    really make my blog jump out. Please let me know where
    you got your theme. Thanks a lot

    Also visit my web-site Louis Vuitton Bags Outlet

    ReplyDelete