【发布时间】:2011-10-16 07:51:45
【问题描述】:
我有一个新闻源,它显然是由 .当用户将鼠标悬停在每个项目上时,背景会突出显示。我还想在每个项目的右上角有一个小“x”,仅在悬停时显示。这个“x”将是删除该帖子的删除按钮。
现在我只有一些基本的 html 声明:<div class="hide-button"><a href="#">x</a></div>
我知道我不想在 html 中显示“x”,而是在 CSS 中显示它。所以我有下面的<li> css 用于悬停,以及用于隐藏按钮的 CSS。我想知道将隐藏按钮 div 集成到 <li> 的最佳方法
.hide-button {
float: right;
margin-top: -13px;
font-size: 11px;
font-family: helvetica;
color: gray;
}
.hide-button a{
text-decoration: none;
color:gray;
}
.hide-button a:hover {
text-decoration: underline;
color:gray;
}
还有名单:
.newsfeedlist li {
background: white;
border-bottom: 1px solid #E4E4E4;
padding: 12px 0px 12px 0px;
overflow: hidden;
}
.newsfeedlist li:hover {
background-color: #F3F3F3;
}
非常感谢!!!!!!
【问题讨论】:
-
你能添加你的 HTML 吗? jsFiddle demo 您目前所拥有的内容也会有所帮助。
-
当然,等一下
标签: html css background hover