Home  >  Article  >  Web Front-end  >  Solution to the blank right side of the background image when the window is reduced using CSS

Solution to the blank right side of the background image when the window is reduced using CSS

高洛峰
高洛峰Original
2017-03-27 17:32:362553browse

Solution to the bug that the right side of the CSS background image appears blank when the window is small (compatible with all browsers)

Solution to the blank right side of the background image when the window is reduced using CSS

Solution:

In css Add the following two lines of code and let it decide for itself:

width:expression(document.body.clientWidth min-width:960px;

That is:

.top{
    border:0px solid #f00;
    width:expression(document.body.clientWidth <= 960? "960px": "auto");
    min-width:960px;
    height:29px;
    margin:0px;
    padding:0px;
    url(.. /img/topbar.png) repeat-x;
}

ok, this bug is finally solved.

The above is the detailed content of Solution to the blank right side of the background image when the window is reduced using CSS. 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