PDA

View Full Version : Alternative to :before for inline image?


Jim K
04-14-2007, 05:40 PM
I would like to insert an small bullet image before selected links that I will identify with an <a class.

I figured that I could just put 15px of padding-left and then use a background image. This works fine if I use display: block on my link, but that doesn't work for me. I need to leave the links inline.

As far as I can tell :before is not supported by IE.

Does any one have any ideas?

Thanks!

Jim

twodayslate
04-14-2007, 06:27 PM
Why not use a list? Then you get bullets.

Arbitrator
04-15-2007, 02:41 AM
I figured that I could just put 15px of padding-left and then use a background image. This works fine if I use display: block on my link, but that doesn't work for me. I need to leave the links inline.You could try display: inline-block. Supposedly, Internet Explorer supports this, but only on naturally inline elements and with bugs. Opera supports it. Firefox does not, although it has the buggy alternatives called display: -moz-inline-block and display: -moz-inline-box.

As far as I can tell :before is not supported by IE.The :before and :after pseudo‐elements are not supported by Internet Explorer. You could probably duplicate their behavior by either inserting the content manually or by using JavaScript.