跨浏览器合规性 - Bing壁纸网络刮痧

时间:2014-05-11 16:03:56

标签: css internet-explorer web-scraping browser compatibility

我正在尝试显示Bing主页 here
它是一个Web抓取工具,可以找到图像URL并进行设置 作为背景图片。
但是像往常一样,Internet Explorer总是存在问题。 但我希望IE11能够很好地处理它。然而,它没有。 我的目标是放大和缩小, 背景图片不应该调整大小。
Google Chrome和Mozilla Firefox上的一切正常。 我想尝试一下 在所有浏览器上看起来都一样。我该怎么做?

这是我的代码:

echo '<!DOCTYPE html>';
echo '<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>';
echo '<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />';
echo "<title>Bing Wallpaper Scraper</title>";
$style="body {
background-image: url('$v');
-moz-background-size: cover;
-o-background-size: cover;
-webkit-background-size: cover;
background-size: cover;
background-position: top center !important;
background-repeat: no-repeat !important;
background-attachment: fixed;
}";
echo "<style>$style</style>";
echo "</head>";
echo "<body>";//background='$v'
echo "<div style='text-align:center;'>";
echo "<h1 style='color:white'> I did it! </h1>";
echo "<h2 style='color:white'> You too can! </h2>";
echo "</div>";
echo "</body></html>";

变量$ v具有来自Web scraper的图像URL。 就像在this xml文档或this json输出中一样。

1 个答案:

答案 0 :(得分:0)

删除背景附件属性,您将获得所需内容。