【问题标题】:I have an image that leads to an external link, but after I move the image down, the link can't be clicked anymore我有一个指向外部链接的图像,但是在我将图像向下移动后,无法再单击该链接
【发布时间】:2021-07-16 02:23:52
【问题描述】:

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>

【问题讨论】:

    标签: html css image hyperlink


    【解决方案1】:

    我认为你错过了在 css 中声明类

     <style>
     .youtube {    /* or other class name for which you needed this css */
          position: relative; 
          width:700px;
          float: right;
          height:400px;
          top: 740px;
       }
      </style> 
    

    【讨论】:

    • 不,没有任何改变。我相信这与图像以某种方式移动有关,因为如果我取出top: 740px;,它就可以正常工作。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2010-12-25
    • 1970-01-01
    • 2012-12-20
    • 1970-01-01
    • 1970-01-01
    • 2011-07-23
    • 1970-01-01
    相关资源
    最近更新 更多