文本的颜色已经改变,但它似乎不可点击我不确定我在哪里犯了这个错误我是 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>
最佳答案
以下完整的 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检查点击链接是否出现错误。
关于html - href 链接不可点击,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59312159/