Home >Web Front-end >Front-end Q&A >What to do if the ie css background image does not display

What to do if the ie css background image does not display

藏色散人
藏色散人Original
2021-04-26 09:23:092441browse

ie The css background image is not displayed because the css setting background image uses css attributes that are not supported by the IE browser. The solution is to use abbreviated attributes instead of using individual attributes, because abbreviated attributes are more It's better supported in older browsers and requires fewer letters to type.

What to do if the ie css background image does not display

The operating environment of this article: Windows7 system, HTML5&&CSS3 version, Dell G3 computer.

Sometimes the background image set by css after we write the web page will often not be displayed in the IE browser. Why does the background image set by css not be displayed in the IE browser?

Let’s take a look at the reason why the background image set by css in IE browser is not displayed:

The reason why the css setting in IE browser is not displayed is because IE is used when css sets the background image. CSS property not supported by the browser.

When we set the background image, we will use the rgba attribute to set the color and transparency of the background image.

For example:

background: url(../images/in_bon_02.png) no-repeat scroll 0 0 rgba(0, 0, 0, 0);

At this time, there is Background images may not be displayed.

rgba introduction:

The rgba color mode is the same as RGB, except that Alpha transparency is added to the RGB mode.

Description:

RGBA(R,G,B,A)

Value:

R: red value. Positive integer | Percent G: green value. Positive integer | Percent B: blue value. Positive integer | Percent A: Alpha transparency, value between 0 and 1.

IE6.0-8.0 does not support using rgba mode to achieve transparency, you can use IE filter processing.

It is generally recommended to use abbreviated attributes rather than using individual attributes, because abbreviated attributes are better supported in older browsers and require fewer letters to be typed.

【Recommended learning: css video tutorial

The above is the detailed content of What to do if the ie css background image does not display. For more information, please follow other related articles on the PHP Chinese website!

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