为什么我的图标/按钮无法在Chrome托管的网站上加载

时间:2019-04-26 18:17:39

标签: html css google-chrome

问题

我目前正在尝试为我的网站添加google +和Facebook按钮。当加载到chrome,firefox和edge上时,按钮/图标显示在我的本地html文档上。当我托管我的网站(带有Firebase)时,它仅显示在Firefox和Edge上。

Google Chrome浏览器中的当前外观: https://cdn.discordapp.com/attachments/163483510701555712/571396872216772618/unknown.png

我尝试过的

我尝试从我的src字体URL中删除#iefix,但这没有用。我也尝试过重新下载该软件包并进行重置,但效果不佳。

当前代码

如果需要,我可以显示更多代码。

CSS

@font-face {
    font-family: 'icomoon';
    src: url("../fonts/icomoon.eot?q2xewv");
    src: url("../fonts/icomoon.eot?q2xewv#iefix") format("embedded-opentype"), url("../fonts/icomoon.woff?q2xewv") format("woff"), url("../fonts/icomoon.ttf?q2xewv") format("truetype"),  url("../fonts/icomoon.svg?q2xewv#icomoon") format("svg");
    font-weight: normal;
    font-style: normal; }

  [class^="icon-"], [class*=" icon-"] {
    /* use !important to prevent issues with browser extensions that change fonts */
    font-family: 'icomoon' !important;
    speak: none;
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    /* Better Font Rendering =========== */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale; }

.btn {
  display: inline-block;
  font-weight: 400;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  user-select: none;
  border: 1px solid transparent;
  padding: 0.9375rem 1.875rem;
  font-size: 1rem;
  line-height: 1.5;
  border-radius: 0.25rem;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; }
  @media screen and (prefers-reduced-motion: reduce) {
    .btn {
      transition: none; } }
  .btn:hover, .btn:focus {
    text-decoration: none; }
  .btn:focus, .btn.focus {
    outline: 0;
    box-shadow: 0; }
  .btn.disabled, .btn:disabled {
    opacity: 0.65; }
  .btn:not(:disabled):not(.disabled) {
    cursor: pointer; }

.btn-ico {
  position: relative;
  width: 3.375rem;
  height: 3.375rem;
  padding: 0; }
  .btn-ico [class*="icon"] {
    -webkit-transform: translate(-50%, -50%);
    -moz-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
    position: absolute;
    top: 50%;
    left: 50%; }
  .btn-ico.btn-sm, .btn-group-sm > .btn-ico.btn {
    width: 2.5rem;
    height: 2.5rem; }
  .btn-ico.btn-lg, .btn-group-lg > .btn-ico.btn {
    width: 3.7rem;
    height: 3.7rem; }
  .btn-ico.btn-xl {
    width: 5.9rem;
    height: 5.9rem; }

.btn-google-plus {
  color: #fff;
  background-color: #dd4b39;
  border-color: #dd4b39; }
  .btn-google-plus:hover {
    color: #fff;
    background-color: #cd3623;
    border-color: #c23321; }
  .btn-google-plus:focus, .btn-google-plus.focus {
    box-shadow: 0 0 0 0 rgba(221, 75, 57, 0.5); }
  .btn-google-plus.disabled, .btn-google-plus:disabled {
    color: #fff;
    background-color: #dd4b39;
    border-color: #dd4b39; }
  .btn-google-plus:not(:disabled):not(.disabled):active, .btn-google-plus:not(:disabled):not(.disabled).active,
  .show > .btn-google-plus.dropdown-toggle {
    color: #fff;
    background-color: #c23321;
    border-color: #b7301f; }
    .btn-google-plus:not(:disabled):not(.disabled):active:focus, .btn-google-plus:not(:disabled):not(.disabled).active:focus,
    .show > .btn-google-plus.dropdown-toggle:focus {
      box-shadow: 0 0 0 0 rgba(221, 75, 57, 0.5); }


HTML

<div style="padding:15px;" class="text-center">
<a href="#" onclick="ProviderSignIn(new firebase.auth.GoogleAuthProvider())" class="btn btn-ico btn-google-plus"><i class="icon-google-plus fs-30"></i></a>
<a href="#" onclick="ProviderSignIn(new firebase.auth.FacebookAuthProvider())" class="btn btn-ico btn-facebook"><i class="icon-facebook fs-30"></i></a>
</div>

结果应该是

我希望代码在chrome上显示带有图标的按钮。

在所有其他浏览器中的外观: https://cdn.discordapp.com/attachments/163483510701555712/571396690180046849/unknown.png

0 个答案:

没有答案