Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/86.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 页面中的浮动链接_Html_Internet Explorer 8_Css Float - Fatal编程技术网

Html 页面中的浮动链接

Html 页面中的浮动链接,html,internet-explorer-8,css-float,Html,Internet Explorer 8,Css Float,我想做一个浮动链接,无论用户是否上下滚动页面,它都会显示在网页中 <div id="valids" style="position: fixed; bottom: 5px; left: 5px;"> <a href="http://validator.w3.org/check?uri=referer" class="valid"> <img alt="Valid XHTML 1.0" src="http://www.w3.org/Icons/valid-xhtml1

我想做一个浮动链接,无论用户是否上下滚动页面,它都会显示在网页中

<div id="valids" style="position: fixed; bottom: 5px; left: 5px;">
<a href="http://validator.w3.org/check?uri=referer" class="valid">
<img alt="Valid XHTML 1.0" src="http://www.w3.org/Icons/valid-xhtml10-blue" style="border: 0pt none ; width: 88px; height: 31px;"/></a>
<a href="http://jigsaw.w3.org/css-validator/validator?uri=http://www.reapercharlie.com" class="valid">
<img alt="Valid CSS 2.1" src="http://jigsaw.w3.org/css-validator/images/vcss-blue" style="border: 0pt none ; width: 88px; height: 31px;"/></a>
</div>

这在Firefox、Chrome、IE9及以后的版本中都得到了完美的展示。 但我至少需要让它与IE8和IE7一起工作

在IE8和IE7中,内容随着页面内容的增加而增加

这篇文章建议您需要添加doctype以使IE7/8触发标准模式,您尝试过这个吗

如果不想乱搞doctype,可以尝试改用jQuery

使用上面的代码,您可以简单地连接到window scroll事件,并随窗口手动滚动框。看起来很不错,但我还没有在IE 7/8上测试过


希望有帮助

添加了代码。粘贴代码时出现问题。别担心,别忘了标记为已回答!(绿色勾号):)
$(window).scroll(function() {
    var scrollTop = $(window).scrollTop();
    $("#mybox").css("top", scrollTop + "px");
});​