Home >Web Front-end >HTML Tutorial >Solution to the problem that the background image of a tag is not displayed under IE8_HTML/Xhtml_Web page production

Solution to the problem that the background image of a tag is not displayed under IE8_HTML/Xhtml_Web page production

WBOY
WBOYOriginal
2016-05-16 16:36:341285browse

I encountered a small problem today and struggled with it for a long time. I want to share the

a tag to add a background image. I need to add the display:block style

to a. However, the background image still cannot be displayed under IE8. Let’s start. 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:

Copy code
The code is as follows:

background: url('./img/active/legendBg.png')no- repeat


After modification:

Copy code
The code is as follows:

background: url('./img/active/legendBg.png') no-repeat

Did you notice, it’s because of that space. .
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn