当top: 740px;
代码不在时,超链接工作得很好,但一旦我向下移动图像,链接就无法再单击了。我该怎么做才能使外部链接随图像向下移动,并且仍然可以单击?
<style>
position: relative;
width:700px;
float: right;
height:400px;
top: 740px;
</style>
<div class="youtube">
<a href="https://youtube.com">
<img src="https://via.placeholder.com/150.jpeg" alt="youtube">
</a>
</div>
我想您错过了在css 中声明类
<style>
.youtube { /* or other class name for which you needed this css */
position: relative;
width:700px;
float: right;
height:400px;
top: 740px;
}
</style>