Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Sprites questions Re: Sprites questions

#97319
Flyer
Member

you got me wrong :)
First one
bo

dy {
font-family:Arial, Helvetica, Tahoma, sans-serif;
font-size: 62.5%;
text-align:center;
background: #222 url(images/back.png) repeat top left;
color: #aaa;
}

it takes picture and makes background by repeating it. this picture was separate file.
now, what i’m trying to do.
i placed this picture in file with other file (sprite). Part of sprite that have pic needed for background is on -172px -177px positions and have size 60x60px. So what should i write instead of

background: #222 url(images/back.png) repeat top left;

to have picture take from sprite and then displayed correctly?

Second question is:
I have style

#box
{
width: 195px;
height: 142px;
border: 3px solid rgb(78, 77, 77);
margin: 3px;
}

#title_box
{
display:block;
background-image:url('gray.png');
height: 29px;
width: 195px;
}

#title_text
{
display:block;
font-size: 9pt;
font-family: Arial, sans-serif;
color: #EBEBEB;
margin-left: 2px;
padding-top: 7px;
}

#number_box
{
display:block;
background-image:url('gray.png');
height: 29px;
float: right;
width: 50px;
margin-top: 91px;
bottom: 0px;
}

#number_text
{
display:block;
color: #EBEBEB;
text-align: center;
font-family: Arial, sans-serif;
margin-top: 3px;
font-size: 15pt;
}

which in html looks like



Test

13



and produces
http://i43.tinypic.com/6zmryd.jpg
since older ie don’t understand rgba, i’ve decided to use 1×1 semi transparent gray picture as background for 2 boxes you can see on pic under “test” and “13”. Now I want to take this 1x1px pic from sprite instead of separate file. So what should i write in #number_box and #title_box to do it?
Hope i explained it well enough :)