gpt4 book ai didi

HTML 超链接失败 : Coding Clash?

转载 作者:行者123 更新时间:2023-11-28 16:21:10 26 4
gpt4 key购买 nike

过去一周,我一直在通过基础教程学习 HTML 和 CSS,并一直在尝试重新创建我多年前使用 Squarespace(一个简单的构建器)创建的网站。昨天我无法添加图像链接,但通过添加 div 标签实现了这一点,我的其余链接现在不起作用。我的编码有冲突吗?在这里:

<style type="text/css">
body {background-image: url(THX1138.jpg);
background-size: cover; background-position: inherit}
h1 {text-transform: uppercase;height:70%;width: 100%; display: flex; position: fixed; align-items: center;justify-content: center; font-family: helvetica}
table {text-transform: lowercase;height:90%;width: 100%; display: flex; position: fixed; align-items: center;justify-content: center; font-family: monospace;}
a:link{text-decoration: none; margin: 2px; color: black;}
a:visited{color:black}
a:hover{background-color: #f7d8d8; padding: 3px;
-o-transition:color .2s ease-out, background .3s ease-in;
-ms-transition:color .2s ease-out, background .3s ease-in;
-moz-transition:color .2s ease-out, background .3s ease-in;
-webkit-transition:color .2s ease-out, background .3s ease-in;}
#twitterbird {height: 102%; width: 100%;display:flex;position:fixed;align-items: center;justify-content: center;}

</style>
<html>
<body>

<h1>The Alcoves</h1>

<table width="50%" cellspacing="20">
<tr>
<a href="index.html"><td> Reviews</td></a>
<a href="index%203.html"><td> Features</td></a>
<a href="index%202.html"><td> About Us</td></a>
</tr>
</table>

<div id="twitterbird"><a href="https://twitter.com/AlcovesFilm">
<img src="twitter%20bird.png" height="40" width="40" alt="Twitter">
</a></div>

</body>

</html>

非常感谢任何帮助!

编辑:我意识到 href 位于 td 的错误一侧。我只是在四处寻找修复而忘记将其改回。认为问题出在覆盖其他链接的 div 上,但我需要 div 将 img 放到正确的位置并使 img 上的链接正常工作。有什么想法吗?

编辑 2:想通了。我误解了 div 实际上是什么。对于高度和宽度,我改变的是 div 的大小而不是它的位置,这是我没有意识到的。我所需要的只是顶部和左侧的命令。感谢大家的评论!

最佳答案

问题是您设置了 #twitterbird div 覆盖整个页面。链接正在工作,但它们被相关的 div 覆盖,因此鼠标无法“访问”链接。

正如其他发帖者所指出的,您还需要移动您的 <a> <td> 内的标签标签。

关于HTML 超链接失败 : Coding Clash?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51542613/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com