首页 > 解决方案 > href链接不可点击

问题描述

文本的颜色已更改,但似乎不可点击我不确定我在哪里犯了这个错误我对 HTML 和 CSS 很陌生

.column {
  float: left;
  width: 50%;
  padding: 10px;
  height:800px;
  text-align: center;
  color: white;
  position: relative;
 }

 .centered {
    position:absolute;
    top: 430px;
    left: 300px;
    width: 100%
}
<!DOCTYPE html>
<html>
<div class="row">
  <div class="column" style="background-color:#aaa;">
    <img src="4.jpg"alt="Snow">
     <div class="centered"><a href="http://www.google.com">Google</a></div>
  </div>

标签: htmlcsssharepoint

解决方案


以下完整的 HTML 代码供您参考。在 SharePoint 中,您可以将代码添加到 Web 部件页面中的脚本编辑器 Web 部件中以检查它是否有效。

<!DOCTYPE html>
<html>
<head>
    <style>
    .column {
        float: left;
        width: 50%;
        padding: 10px;
        height:800px;
        text-align: center;
        color: white;
        position: relative;
    }

    .centered {
        position:absolute;
        top: 430px;
        left: 300px;
        width: 100%
    }
    </style>
</head>
<body>
<div class="row">
  <div class="column" style="background-color:#aaa;">
     <img src="4.jpg" alt="Snow"/>
     <div class="centered"><a href="http://www.google.com">Google</a></div>
  </div>
</div>
</body>
</html>

如果href链接仍然无法点击,您可以使用IE/chrome F12检查点击链接时是否出现错误。


推荐阅读