Home >Web Front-end >HTML Tutorial >How to solve the problem that the background image of the a tag is not displayed in IE8
This time I will bring you how to solve the problem that the background image of the a tag does not display under IE8. How to solve the problem that the background image of the a tag does not display under IE8. What are the precautions? What are the following? This is a practical case, let’s take a look at it.
I encountered a small problem the other day. I struggled with it for a long time. I want to share it with
a tag to add a background image. I need to add display:block style to a
but in The background image still cannot be displayed under IE8. At first I thought it was because the a tag was empty. I tried adding content but it didn’t work. Then I noticed a little detail and it can be displayed normally after modification.
Before modification:
background: url('./img/active/legendBg.png')no-repeat
After modification:
background: url('./img/active/legendBg.png') no-repeat
Did you notice, it’s because of that space. .
I believe you have mastered the methods after reading these cases. For more exciting information, please pay attention to other related articles on the php Chinese website!
Related reading:
How to use the head structure in HTML
Important attributes compatible with IE8X-UA- Compatible
How to use iframe to display weather on your webpage
The above is the detailed content of How to solve the problem that the background image of the a tag is not displayed in IE8. For more information, please follow other related articles on the PHP Chinese website!