我的工具提示有问题。它没有出现

I have a trouble with tooltip. It doesn't show up

工具提示未显示。我试过在CSS中用
<span id="error-dropdown">Here is error text</span>opacity属性来显示,但无论如何都不显示。 Link

<img src="https://symboldev.pp.ua/_data/error-sign.svg" alt="Error" id="error">
#error {
    height: 30px;
    width: 30px;
}

#error::after {
    content: "Here is the tooltip text";
    display: block;
    width: 300px;
    height: 300px;
    background: #555;

    position: absolute;
    visibility: hidden;
}

#error:hover::after {
    visibility: visible;
}

这是一个解决方案 - 只需在图像周围环绕 link。

#error {
 height: 30px;
 width: 30px;
}

#error::after {
  content: "Here is tooltip text";
  display: block;
  width: 300px;
  height: 300px;
  visibility: hidden;
}

#error:hover::after {
 visibility: visible;
}
<a href="" id="error"><img src="https://symboldev.pp.ua/_data/error-sign.svg" alt="Error" id="error"></a>