分享

新版本 81.0.4044.138 谷歌安装后页面样式改变(高度变窄)

 魏正钦的图书馆 2020-05-20

由于页面使用了bootstrap框架,bootstrap.min.css 样式中使用了

@font-face {

   font-family: 'Glyphicons Halflings';

   src: url('../fonts/glyphicons-halflings-regular.eot');

   src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),

    url('../fonts/glyphicons-halflings-regular.woff2) format('woff2'), 

    url('../fonts/glyphicons-halflings-regular.woff') format('woff'), 

    url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), 

    url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');

    }

每次第二访问页面时:glyphicons-halflings-regular.woff2 文件被缓存影响了css样式,在glyphicons-halflings-regular.woff2 添加随机数,防止缓存即可解决问题。代码如下:

  @font-face {

   font-family: 'Glyphicons Halflings';

   src: url('../fonts/glyphicons-halflings-regular.eot');

   src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),

    url('../fonts/glyphicons-halflings-regular.woff2?v=<%=Math.random()%>') format('woff2'), 

    url('../fonts/glyphicons-halflings-regular.woff') format('woff'), 

    url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), 

    url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');

    }

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多