PDA

View Full Version : CSS Image Replacement



wyclef
November 18th, 2004, 10:42 AM
Hi,

I'm trying to use the text-indent method for image replacement but am having trouble in Opera ignoring the float. Have a look...



<div id="heading"><h2 title="A-C">A-C</h2></div>




#heading h2 {
text-indent: -9000px;
width: 175px; height: 35px;
margin: 0; padding: 0;
background: url(/a-c.gif) no-repeat top left;
}



I've been able to hack the image in Opera to the position I want it to go by adding a margin-left style to the #heading id, but i was wondering if there is a better workaround than that.

ditt0
November 18th, 2004, 11:15 AM
Afaik , Opera ignores the negative sign, "-" that is, in text-indent.
Did you take a look at the code of the links i gave you for the image map?
http://www.kirupaforum.com/forums/showthread.php?t=76483

wyclef
November 18th, 2004, 01:35 PM
If I made the text-indent positive would that solve the problem? Yes, i did look at the code for the image map. Thanks so much, it was really helpful!

ditt0
November 18th, 2004, 04:43 PM
Yes, positive value should solve the problem. But what i meant was, in those examples I used negative margin . Why don't you try to use that for image replacement? It's less buggy, as far as i tested.