【问题标题】:Change table information on mouseover?在鼠标悬停时更改表格信息?
【发布时间】:2011-10-11 16:36:11
【问题描述】:

我知道这与我的另一个问题相似,但我太难理解了,所以我做了这个

我有两个标签:

“搜索”和“标签”

“搜索”是默认选项卡,所以我在文本后面的表格中有一个圆角框,但不是作为背景

当我将鼠标放在“标签”上时,我希望这个圆边框位于“标签”标签的后面

我该怎么做?

HTML:

<table height="20" width="30" cellpadding="0" cellspacing="0">
<tr>
<td>

<div class="roundedcornr_box_407494">
<div class="roundedcornr_top_407494"><div></div></div>
   <div class="roundedcornr_content_407494">
      <font color="#ffffff" size="2" face="helvetica">
 Search
</font>  
  </div>
<div class="roundedcornr_bottom_407494"><div></div></div>
</div>

</td>
</tr>
</table>

</td>
<td>
<div style="margin-left:10px;" />
<center>
<table height="20" width="30" cellpadding="0" cellspacing="0" >
<tr>
<td>
<center>
<div class="roundedcornr_box_235759">
<div class="roundedcornr_top_235759"><div></div></div>
   <div class="roundedcornr_content_235759"> 
<font color="#585858" size="2" face="helvetica">
 Tags
</font>      </div>
    <div class="roundedcornr_bottom_235759"><div></div></div>
</div>
</center>
</td>
  </tr>
  </table>

CSS:

.roundedcornr_box_407494 {
background: #bdbdbd;
}
.roundedcornr_top_407494 div {
background: url(roundedcornr_407494_tl.png) no-repeat top left;
}
.roundedcornr_top_407494 {
background: url(roundedcornr_407494_tr.png) no-repeat top right;
}
.roundedcornr_bottom_407494 div {
background: url(roundedcornr_407494_bl.png) no-repeat bottom left;
}
.roundedcornr_bottom_407494 {
background: url(roundedcornr_407494_br.png) no-repeat bottom right;
}

.roundedcornr_top_407494 div, .roundedcornr_top_407494, 
.roundedcornr_bottom_407494 div, .roundedcornr_bottom_407494 {
width: 100%;
height: 5px;
font-size: 1px;
 }
.roundedcornr_content_407494 { margin: 0 5px; }

谢谢!

詹姆斯

【问题讨论】:

  • 嗯,你是不是把 Java 和 JavaScript 混为一谈了?也许您想更改标签?如果不是,请告诉我们这篇文章与 Java 编程有什么关系。

标签: html mouseover


【解决方案1】:

你可以给你的标签 div 一个 ID,然后当鼠标悬停时将它的类更改为与 Seach 相同,然后鼠标移出。

您应该尝试将所有样式都放在 CSS 中,因为您混合了中心和字体标签。此外,许多新的浏览器都提供了对 css3 的圆角支持,这可能对您来说不是一个修复,但只是想指出这一点。

【讨论】:

  • 谢谢!那么我可以添加 div id="dark" 例如吗?然后如何将其链接到 onmouseover="" ???
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2017-01-12
  • 2012-06-24
  • 2013-12-10
  • 2014-01-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多