【问题标题】:Nothing happens on clicking social icons on mobile点击移动设备上的社交图标没有任何反应
【发布时间】:2021-07-21 23:47:08
【问题描述】:

我在我的网站上创建了一些社交媒体图标。我的链接在桌面上运行良好,但在移动浏览器中点击它们没有任何反应。这是网站https://theopenbay.weebly.com,这是代码——

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<style>
.fa {
  padding: 10px;
  font-size: 30px;
  width: 30px;
  text-align: center;
  text-decoration: none!important;
  margin: 5px 2px;
  border-radius:50%;
}

.fa-facebook {
  background: #3B5998;
  color: white;
}

.fa-telegram {
  background: #30a2e7;
  color: white;
}

.fa:hover {
    opacity: 0.7;
}

</style>
</head>
<body>

<!-- Add font awesome icons -->
<a href="https://www.facebook.com/TheOpenBay" target="_blank" class="fa fa-facebook"></a>
<a href="https://t.me/TheOpenBay" target="_blank" class="fa fa-telegram"></a>
</body>
</html> 

【问题讨论】:

    标签: html css responsive-design mobile-website weebly


    【解决方案1】:

    欢迎来到 SO。我发现了这个问题。图标被“navmobile”元素阻止。它覆盖了图标,因此无法“按下”图标。

    这是由该元素的显示块样式引起的。因此,通过删除它,您将能够使这些图标再次可点击。

    【讨论】:

    • 很高兴您找到了问题!但是,当我删除显示块样式时,导航内容也会被删除。看到这个imgur.com/quZnDXp
    • 嗨,也许你可以让导航显示:仅在活动时阻止。这样它就不会阻止您应用的进一步交互。
    • 我该怎么做?
    • 嘿,感谢您的帮助,我通过将 display: block 更改为 display: table 来解决它,这降低了 navmobile 的高度。
    • 干得好,伙计!
    【解决方案2】:

    您的问题是,div#navmobile 与您的页脚重叠,#navmobile 具有 z-index:8,您可以做的是,您可以将 div#my-footer 的位置更改为相对位置,并且 z-index 高于 8 ,这里是代码(你应该添加到css):

    #my-footer{position:relative; z-index:99}
    

    【讨论】:

    • 在这些类中使用 div 上的 stile:
    • 嘿,感谢您的帮助,我通过将 display: block 更改为 display: table 来解决它,这降低了 navmobile 的高度。
    【解决方案3】:

    我通过将display: block 更改为display: table 解决了这个问题,这降低了导航移动的高度。

    背景:上面 Iliass Nassibane 发布的图片。

    【讨论】:

      猜你喜欢
      • 2018-01-04
      • 2014-08-06
      • 2017-12-08
      • 2021-06-18
      • 2013-12-07
      • 1970-01-01
      • 2020-11-21
      • 1970-01-01
      • 2012-02-18
      相关资源
      最近更新 更多