CSS question (why don't my graphics show in IE?)

Discuss all aspects of programming here.

Moderator: The Mod Squad

CSS question (why don't my graphics show in IE?)

Postby filecore » Thu Jun 19, 2008 4:29 am

Okay, here's the deal. If you go to http://www.hnnky.fi/test/ in Firefox, you'll see a graphical link on the last line of the main section, to helsingin.nnky@ the domain. I've achieved this through CSS, because in my HTML I have things like these:

Code: Select all
<a href="mailto:blah@domain.com"></a>

Code: Select all
<a href="mailto:hnnky@domain.com"></a>

Code: Select all
<a href="mailto:woo@domain.com"></a>


For each of those - blah, hnnky, and woo, in this case - I have created a rule in CSS like this:

Code: Select all
a[href ^="mailto:hnnky"] {
   padding: 5px 80px 5px 0;
    background: transparent url(/ims/email-hnnky-at-hnnky-fi.jpg) no-repeat center right;
}


The underlying logic is that when the file is parsed, the CSS sees the "mailto:hnnky", and anything starting with that string has a graphic inserted into it. In Firefox this displays perfectly well. However, in IE I have had varying reports on the effects; some claim that nothing happens at all, while my own observations (both in IE and with IETabs in FF) are that the link is there, with the given amount of pixels, but the graphic itself is invisible. I'm not sure why it works in FF and not in IE; can anybody give me any hints, or a workaround, or even a better piece of code to use?

My original intention was simply to replace the text content of the links with a graphic of the email address, but I wanted to do it centrally with rather than per file with an img. If I were using an HTML img tag, it would be easier because the alt text would replace any non-displaying image, but I don't think there's a CSS way to do alt tags. It's probably all some ghastly FF hack anyway, so I'd like some helpful, knowledgeable person's feedback please :D

IE 7
FF 2.0.0.14
Last edited by filecore on Thu Jun 19, 2008 4:43 am, edited 1 time in total.
Home server: Asus P5Q Pro, Core2Quad, 8GB DDR2, ENGTX260 876MB, Zalman 800w, Antec P180 case, 2x1TB and 2x2TB Samsung Spinpoint F1, Windows 7 64-bit, etc

Work server: HP ProLiant ML350 G6, hexacore Xeon E5645 2.4GHz (12 logical cores), 16GB DDR3, 3x300GB SAS RAID5, Server 2008 R2, nVidia GT560Ti 1GB for Hyper-V RemoteFX acceleration
filecore
Black Belt 1st Degree
Black Belt 1st Degree
 
Posts: 1092
Joined: Mon Dec 29, 2003 10:35 am
Location: Trapped inside a virtual machine.

Postby filecore » Thu Jun 19, 2008 4:41 am

Curious. On this page, http://www.hnnky.fi/test/contact.shtml, you can see four email addresses (although only in FF, natch). All of them were with graphics, but since I played with the first one, it seems to have magically vanished. The other three are still extant. I can't work this out. I suspect it's to do with my having nothing between the <a href="mailto:whatever"> and the </a>; but if I put something in, the graphic is overridden by the text anyway.
Home server: Asus P5Q Pro, Core2Quad, 8GB DDR2, ENGTX260 876MB, Zalman 800w, Antec P180 case, 2x1TB and 2x2TB Samsung Spinpoint F1, Windows 7 64-bit, etc

Work server: HP ProLiant ML350 G6, hexacore Xeon E5645 2.4GHz (12 logical cores), 16GB DDR3, 3x300GB SAS RAID5, Server 2008 R2, nVidia GT560Ti 1GB for Hyper-V RemoteFX acceleration
filecore
Black Belt 1st Degree
Black Belt 1st Degree
 
Posts: 1092
Joined: Mon Dec 29, 2003 10:35 am
Location: Trapped inside a virtual machine.

Postby Deman Risu » Wed Sep 30, 2009 6:33 pm

Why don't you make an IE version of your page:

"This page doesn't work with Internet Explorer because it sucks. Switch to Firefox, Chrome, Safari, or Opera and try again."
Deman Risu
Pilgrim
Pilgrim
 
Posts: 6
Joined: Wed Sep 30, 2009 6:04 pm

Postby fussnfeathers » Thu Oct 01, 2009 11:27 am

You just have the typical issue of IE not using standard programming. The majority of programs in the last few years have worked around that, but you still have to code for IE, and then slightly differently for everything else.

The ironic thing is that with IE8, MS decided to go with the true HTML standard, which means that everything coded for their incompatible versions of IE have to be recoded. Again.
Faster than the speed of snot

and for the million hours that we were....well I'll smile and remember them all, then I'll turn and go....
fussnfeathers
Mobo-fu Master
Mobo-fu Master
 
Posts: 3130
Joined: Thu Dec 04, 2008 8:25 pm
Location: Right behind you

Postby filecore » Thu Oct 01, 2009 11:48 am

Wow, old thread. I think I solved the problem eventually but I can't be bothered checking to see right now. Sorry! It's late where I am :)

The problem, annoyingly, is not so much that it's different rules in IE - coding an alternative is one thing - but that it's utterly inconsistent and doesn't necessarily work the same two times in a row. Surely that ought not to be?

That said, Expression Web is more or less standards compliant, and actually fairly decent; hopefully it will finally be a death knell for the horror that is FrontPage...
Home server: Asus P5Q Pro, Core2Quad, 8GB DDR2, ENGTX260 876MB, Zalman 800w, Antec P180 case, 2x1TB and 2x2TB Samsung Spinpoint F1, Windows 7 64-bit, etc

Work server: HP ProLiant ML350 G6, hexacore Xeon E5645 2.4GHz (12 logical cores), 16GB DDR3, 3x300GB SAS RAID5, Server 2008 R2, nVidia GT560Ti 1GB for Hyper-V RemoteFX acceleration
filecore
Black Belt 1st Degree
Black Belt 1st Degree
 
Posts: 1092
Joined: Mon Dec 29, 2003 10:35 am
Location: Trapped inside a virtual machine.

Postby evasive » Thu Oct 01, 2009 12:01 pm

There's no irony in data generated with/for previous versions of M$ software being incompatible with the current version. I really think that is by design so they have to write some cr*ppy conversion software wizard that fubars your data and you have to rebuild it by hand or export to csv first :o
We hate rut, but we fear change.
********************************
System error, strike any user to continue...
evasive
Mobo-fu Master
Mobo-fu Master
 
Posts: 36856
Joined: Sun May 06, 2001 12:01 am
Location: Netherlands

Postby fussnfeathers » Thu Oct 01, 2009 12:06 pm

I know..........I used Frontpage a long time ago, it was so awful I learned HTML the hard way. It was easier. Right now a site I work on uses ASP. Not all that fond of it, but it works well and is pretty compliant across the board. The only thing I use CSS on anymore is a single Myspace page that I'm tempted to ditch anyway, if I didn't have the professional contacts I have on it.

Not a bad thread to resurrect now, though, what with IE8 and the newest version of FF. Honestly, 3.5.2 is pretty nasty, and I've been using it since it was named Phoenix (actually, earlier, I managed to get on board when it was still called SeaMonkey).
Faster than the speed of snot

and for the million hours that we were....well I'll smile and remember them all, then I'll turn and go....
fussnfeathers
Mobo-fu Master
Mobo-fu Master
 
Posts: 3130
Joined: Thu Dec 04, 2008 8:25 pm
Location: Right behind you

Postby filecore » Thu Oct 01, 2009 12:21 pm

I'm with you on both of those - I learned HTML by hand anyway (that's what you get for using RISC OS until 2002 and not going near anything Apple, Microsoft or *nix flavoured), but CSS isn't so bad once you get used to it.

As for Firefox, 3.x was pretty decent but I've been using 3.5.x for the past month or so, and I intensely dislike it. Seems like it's on the way downhill again... haven't tried IE8 though, as I dislike it even more (FF is so heavily customised by now that I'm loathe to change it - AdBlock Plus, NoScript, AutoPager, Tab Mix Plus, IETab, User Agent Switcher, Web Developer Toolbar, AutoPager, PhZilla, Reverse IP Lookup, FoxyProxy, Forum Fixer, and of course the Motherboards.org menu plugin - the list goes on and on!).
Home server: Asus P5Q Pro, Core2Quad, 8GB DDR2, ENGTX260 876MB, Zalman 800w, Antec P180 case, 2x1TB and 2x2TB Samsung Spinpoint F1, Windows 7 64-bit, etc

Work server: HP ProLiant ML350 G6, hexacore Xeon E5645 2.4GHz (12 logical cores), 16GB DDR3, 3x300GB SAS RAID5, Server 2008 R2, nVidia GT560Ti 1GB for Hyper-V RemoteFX acceleration
filecore
Black Belt 1st Degree
Black Belt 1st Degree
 
Posts: 1092
Joined: Mon Dec 29, 2003 10:35 am
Location: Trapped inside a virtual machine.

Postby evasive » Thu Oct 01, 2009 2:37 pm

I see, you have a load of plugins running in FF and are surprised it's not really up to scratch? Try running a vanilla version (without plugins).
We hate rut, but we fear change.
********************************
System error, strike any user to continue...
evasive
Mobo-fu Master
Mobo-fu Master
 
Posts: 36856
Joined: Sun May 06, 2001 12:01 am
Location: Netherlands

Postby fussnfeathers » Thu Oct 01, 2009 3:13 pm

evasive wrote:I see, you have a load of plugins running in FF and are surprised it's not really up to scratch? Try running a vanilla version (without plugins).


Might help, but I run absolutely no plugins or extensions beyond core functionality, and it's still pretty horrible. Awful memory hog...........besides, it's about time for a switch, FireFox has been relying too much on reputation, even Microsoft was bound to catch up eventually.
Faster than the speed of snot

and for the million hours that we were....well I'll smile and remember them all, then I'll turn and go....
fussnfeathers
Mobo-fu Master
Mobo-fu Master
 
Posts: 3130
Joined: Thu Dec 04, 2008 8:25 pm
Location: Right behind you

Next

Return to Programming

Who is online

Users browsing this forum: No registered users and 0 guests