Solution to the problem that the background image of a label does not display in IE8

Solution to the problem that the background image of a label does not display in IE8
I encountered a small problem today and struggled for a long time. Let me share it with you.

To add a background image to the a tag, you need to add the display:block style to a.

But the background image still cannot be displayed in IE8. At first I thought it was because the a tag was empty. I tried adding content but it didn't work. Later 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 that? It’s because of that space. .

<<:  9 Tips for MySQL Database Optimization

>>:  A small piece of HTML code will include the Baidu search bar in your page

Recommend

Detailed explanation of Vue element plus multi-language switching

Table of contents Preface How to switch between m...

Detailed explanation of Vue form binding and components

Table of contents 1. What is two-way data binding...

Element Timeline implementation

Table of contents Components - Timeline Custom no...

Example of implementing element table row and column dragging

The element ui table does not have a built-in dra...

JavaScript uses setTimeout to achieve countdown effect

In order to enhance the ability to write JavaScri...

Detailed explanation of the sticky position attribute in CSS

When developing mobile apps, you often encounter ...

How to display div on object without being blocked by object animation

Today I made a menu button. When you move the mous...

Vant+postcss-pxtorem implements browser adaptation function

Rem layout adaptation The styles in Vant use px a...

Three uses and differences of MySQL not equal

Judgment symbols are often used in MySQL, and not...

Linux Check the installation location of the software simple method

1. Check the software installation path: There is...

How to modify the master-slave replication options in MySQL online

Preface: The most commonly used architecture of M...

The iframe refresh method is more convenient

How to refresh iframe 1. To refresh, you can use j...