html - div :hover 问题

标签 html css web hover

我有这个 :hover:

http://jsfiddle.net/andrewhoward_im/hLc42dw3/

<a href="#" id="pin1" class="pin"></a>
<span id="pin1-content" class="pin-content">text</span>

它工作正常。

但是,我已将其添加到自定义 WordPress 主题中 — http://www.letsgobucketlisting.com/ — 我似乎无法让它工作。

最佳答案

也许您网站中的 CSS 规则覆盖了您的自定义 css 规则,试试这个:

.pin-content {
  position: absolute;
  opacity: 0 !important;
  width: 120px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  transition: opacity 0.5s;
  -webkit-transition: opacity 0.5s; 
  border-radius: 5px;
  margin-left: -50px;
  background-color:#333333;
  color: #ffffff;
}

#pin1:hover + #pin1-content {
  opacity: 1 !important;
}

关于html - div :hover 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34141747/

相关文章:

html - 如何使用html5录制音频并保存到本地系统?

CSS 设计和图像

css 边距问题

web - 有没有像谷歌网站这样的免费网站托管

javascript - 在 javascript 中使用回调后解释输出

HTTP GET 请求在查询字符串中包含许多项目

html - 如何禁用从其他div 继承样式?

html - 在 mysql 中删除所有 anchor 标记和其中的任何内容

javascript - 继续将文本动态地放入单独的<p>段落中吗?

php - 在网络上显示 pdf 但无法下载