473,408 Members | 1,854 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

how to add sprite class to image in "css" not in "div"?

mardash
10
Expand|Select|Wrap|Line Numbers
  1. .sprite{
  2. background:url(Sprite.png)
  3. }
  4. .feed{
  5. background-position: -76px 0px;
  6. }
easy i can add sprite to div images like that ...

Expand|Select|Wrap|Line Numbers
  1. <DIV STYLE='position:absolute; right:970px; top:2px;'>
  2. <a href='../feed'><img class='sprite feed' height='32' src='transpernt.png' width='32'/></a></DIV>
now it's ok :)

but i asked if i have image in css not in div like ..

i can make

Expand|Select|Wrap|Line Numbers
  1. .sky{
  2. background-position: -76px 0px;
  3. }
Easy to make sky class .. but the hard thing is
how i replace this skyimage with sprite .. or how i add the class="sprite sky" to it ?
i no see div to add class :(

this's example

Expand|Select|Wrap|Line Numbers
  1. body{
  2. background:#8C1616 url(sky.jpeg)
  3. }
Apr 16 '12 #1
3 1820
Dormilich
8,658 Expert Mod 8TB
Expand|Select|Wrap|Line Numbers
  1. .sprite{
  2. background:url(Sprite.png)
  3. }
  4. .feed{
  5. background-position: -76px 0px;
  6. }
easy i can add sprite to div images like that ...

Expand|Select|Wrap|Line Numbers
  1. <DIV STYLE='position:absolute; right:970px; top:2px;'>
  2. <a href='../feed'><img class='sprite feed' height='32' src='transpernt.png' width='32'/></a></DIV>
now it's ok :)
no, it’s not. <img> elements are not supposed to have a background. (you don’t put a transparent poster on the wall to look at the tapestry either, do you?)
Apr 16 '12 #2
mardash
10
so i can't use sprite with image in css ?
Apr 16 '12 #3
Dormilich
8,658 Expert Mod 8TB
you’re not supposed to use sprites with <img> elements.
Apr 16 '12 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Akbar | last post by:
All, I'm currently using an alt attribute in a div tag to store "keywords" for a function that will show or hide certain div's based on a given keyword. Is there a better (standard) place to put...
17
by: Will Hartung | last post by:
I have a table for a report. It can get wide, but that's no big deal. I don't mind that it can get wide. What I do mind, though, is the browser doing its damndest to smash the thing down to get...
22
by: stephen | last post by:
I have created an order form that users javascript to create a new html document when the customers clicks the "print page" button. Once the new document has been created it then prints the...
5
by: Tobin Fricke | last post by:
In posting to a blog, I would like to bold every list item (<li>). Because I cannot influence the <head>...</head> section of the HTML document, I can neither add a <style>...</style> block, nor...
9
by: Tristán White | last post by:
Hi I am very new to PHP - actually, this is my second day at it, as I've only recently started a new job last week. We're a charity. I have a "No input file selected" problem. A Google search...
1
by: Java Guy | last post by:
I'm trying to view a web page. IE tells me there are (Java?) errors on the page. Here they are: Line: 15 Char: 7 Error: Wrong number of arguments or invalid propert assignment Code: 0 URL:...
6
by: newholborn | last post by:
Hi everyone. I have some questions, which should be rather easy to reply, but as I am working on PHP, JavaScript, XML, CSS, Photoshop and other stuff at the same time, my head, which is about to...
2
by: crumsoft | last post by:
hello every one i have face some problem related to css. my css file work good in firefox but not looking so good and work properly in internet explorer 6.0 plz help me and solve this problem....
1
by: chrisj | last post by:
I'm using freeASPupload and got some assistance integrating to a Member script. It works successfully. In this modified version there are two groups that use this upload script. Members of one...
10
by: Anze | last post by:
Hmmm... anyone? :) Anze Anze wrote:
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.