CSS Sprites Utah

Looking to improve the performance of your site? Learn how to combine all of those tiny 1k styling images into a couple CSS sprites.

Local Companies

LunaWebs.com
801 755-9966
10 W Broadway
Salt Lake City, UT
Luna Webs
(801) 755-9966
10 W Broadway
Salt Lake City, UT
EconoWeb Express
1-888-326-6612
331 South Rio Grande, Suite 305B
Salt Lake City, UT
Xmission
(801) 303-0820
51 East 400 South, Suite
Lake City, UT
Heritage Web Solutions
801-655-1600
1460 N. Moonriver Dr.
Provo, UT
Resonate Media Design LLC
435-674-0308
2238 South 1950 East
Saint George, UT
Fifty Studio
(801) 355-4000
331 South Rio Grande, Suite 305
Salt Lake City, UT
Fifty Studio
801-355-4000
331 South Rio Grande, Suite 305
Salt Lake City, UT
Warner Data Solutions
(801) 648-9324
10 W 100 S #609
Salt Lake City, UT
Riser Media
(801) 492-1903
477 West 50 North, American
Provo, UT

Reducing the number of HTTP requests and the bandwidth used is and will continue to be a challenge as designers build ever more elaborate designs. One area where you can both reduce the number of requests and bandwidth is by combining styling images that creep into the design such as corner images, line images, gradients, backgrounds, and so forth. First, start with the basic uses for styling images, as shown in Figure 1.


Figure 1 Box with rounded corners

This simple box is a common use of styling images; however, it is expensive in terms of the number of requests. This example uses eight individual images (one for each corner and each line). Each of these eight images are show in Figure 2.


Figure 2: Eight images used to create the box

The yellow background is added to make it easier to searpate images. These images can be combined into a couple CSS sprite images; however, before you get there,you need to start with the CSS and see how it changes to use CSS sprites. Following is an exerpt from the CSS used to create the box in Figure 1.




.Top
{
background-image: url(TopLine.png);
height:10px;
width:100%;
background-repeat:repeat-x;
background-position:top center;
}

.TopLeft
{
float:left;
background-image: url(ULCorner.png);
width:10px;
height:10px;
background-position:top left;
}


Read the Rest of this Article at Developer.com

Featured Local Company

Resonate Media Design LLC

435-674-0308
2238 South 1950 East
Saint George, UT
http://www.resonatemediadesign.com


Topics: 
Architecture & Design Languages & Tools Project Management Web Services
Database Microsoft & .NET Security Wireless
Java Open Source Techniques XML