大佬教程收集整理的这篇文章主要介绍了html – 在新标签页打开链接或打开新窗口时,Google Chrome会清除当前页面的CSS样式,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
只适用于Windows版本53.0.2785.116 m(64位).
Web服务器必须具有标题集(在这种情况下,元标记不起作用):
Apache的.htaccess:头设置Cache-Control“no-cache”
或者nginx:add_header Cache-Control no-cache;
您不能使用jsfiddle或内置代码片段重新创建它,因为css文件必须使用< link href ='style.css'rel ='stylesheet'type ='text / css'> ;. (但是我会在代码段中包含代码). 重建步骤:
>访问:http://test.xmpsoft.net/
点击链接1(应该重新加载页面);
>点击链接2(应该打开同一页面的新标签页);
>切换到原始选项卡并重复相同的步骤;
>所有CSS样式都从原始选项卡中删除.
>如果没有,请重复同样的步骤.
请确保在将代码提交给Google之前,该代码没有任何错误.
谢谢.
附:有另一种方法或重新创建它(这就是为什么我在我的标题中提到“新窗口”:访问同一页面,重新加载它,右键单击 – >检查(新开发工具窗口打开),切换回页面能重建).
.menu div { display: inline-block; width: 15em; height: 15em; } .red { BACkground-color: red; } .yellow { BACkground-color: yellow; } .green { BACkground-color: green; }
<!DOCTYPE html> <html> <head> <meta http-equiv='Content-Type' content='text/html; charset=utf-8'> <title>Chrome bug</title> <link href='style.css' rel='stylesheet' type='text/css'> </head> <body> <div class='menu'> <div class='red'>Red</div> <div class='yellow'>Yellow</div> <div class='green'>Green</div> </div> <a href='/'>1. Reload this page</a><br> <a href='/' target='_blank'>2. Open same page in new tab</a> </body> </html>
https://bugs.chromium.org/p/chromium/issues/detail?id=648237#c6
以上是大佬教程为你收集整理的html – 在新标签页打开链接或打开新窗口时,Google Chrome会清除当前页面的CSS样式全部内容,希望文章能够帮你解决html – 在新标签页打开链接或打开新窗口时,Google Chrome会清除当前页面的CSS样式所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。