The application of sprites in CSS

Source: Internet
Author: User
This article mainly introduces the application of sprites in CSS, this is a very simple application, but in the design, this can reduce the pressure on the server, is the number of requests decreased, is a good way .

The instance code is as follows:

Body {   font-family: "Lucida Sans", "Lucida Sans Unicode";   font-size:14px;   line-height:24px; } ul {   list-style-type:none;} li {   float:left;} a{   Background-image:url (bg.gif);   height:26px;   background-position:53px 0px;   Display:block;   margin-right:10px;   width:53px;   Text-align:center;   Color: #333333; } li a:link {   text-decoration:none;} li a:visited {   text-decoration:none;} li a:hover {   text-decoration : none;   background-position:0 0px;//here Specifies that the picture be displayed starting at a certain coordinates}

Summarize:

In this small picture, even two pictures in fact, the response time is not much slower, but there is a problem, is the two pictures alternately prone to the background image from the new load, resulting in a period of time does not show the effect.

Related recommendations:

Reduce picture requests with CSS Sprites

Div+css background a full picture (CSS sprites)

CSS Sprites Technology ZT 10 days Learn WEB standard (DIV+CSS) _html/css_web-itnose

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.