如何使用css在链接按钮中用颜色更改下划线? [英] How to underline word with color change in link button using css ?

查看:115
本文介绍了如何使用css在链接按钮中用颜色更改下划线?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hai

我需要在鼠标悬停时使用css在链接按钮中用下划线更改单词颜色。



实际上我在设计中做了链接按钮的时间,

Hai
I need to change word color with underline in link button using css when mouse over.

Actually i did in design time for link button ,

font-underline="false" 
font-family=" Arial"
    font-size=" 12px"
    font-weight="bold"
    color=" black"



因此它看起来像单词而不是链接按钮(这是我的需要)。我有5个链接按钮都是像上面相同的属性。在每个链接按钮onclienclick事件的javascript我将该颜色更改为蓝色


so it look like word not as link button(this is my need).i have 5 link buttons all are same properties like above.in javascript for each link button onclienclick event i will change that color to "blue"

OnClientClick="return AddDept_ClientClick()"



和javascript


and in javascript

document.getElementById("ctl00_ContentPlaceHolder1_lnkAddDept").style.color = "Blue"
           document.getElementById("ctl00_ContentPlaceHolder1_lnkAddUser").style.color = "black"
           document.getElementById("ctl00_ContentPlaceHolder1_lnkImpADUser").style.color = "black"
           document.getElementById("ctl00_ContentPlaceHolder1_lnkImpUserList").style.color = "black"
           document.getElementById("ctl00_ContentPlaceHolder1_lnkExpUserList").style.color = "black"





bcz所有链接按钮彼此相关。 (即)如果我点击一个链接按钮,该链接按钮chnage为蓝色和其他四个chnage为黑色,所以只有用户知道点击了哪个链接按钮。它将正常工作。

< br $> b $ b

但我需要的是,我需要在链接按钮中实现鼠标悬停概念。

i意味着如果用户悬停链接需要改变颜色下划线的单词,如果鼠标输出则保持默认样式。



如果我为鼠标添加css



bcz all link button related with each other.(i.e) if i click one link button ,that link button chnage to blue color and other four chnage to black color,so only user know which link button is clicked.and it will work fine.


But my need is ,i need to implement mouse hover concept in link button.
i mean if user hover the link need to change color with underline word,if mouse out it stay in default style.

if i add css for mouse over

.change:hover
      {
          color: red;
          text-decoration:underline;

      }



1.underline wo rd不工作。

2.如果我鼠标悬停所有链接按钮颜色只有chnaged,如果我点击任何链接按钮其他获取黑色使用JavaScript这也是我的需要,但如果我尝试mouser再次悬停它不工作,bcz在javascript我会给其他链接按钮的黑色。

如果我删除它将工作,但我需要chnage颜色的链接按钮,当我点击另一个链接按钮。



请回复我如何解决这个问题?



regatds

Aravind


1.underline word not work.
2.if i mouse hover for all link button color only chnaged,if i click any link button other get black color using javascript this is also my need,but if i try to mouser hover again it not work,bcz in javascript i will give black color for other link button.
if i remove javascript it will work,but i need to chnage color of link button when i click another link button.

pls reply me how to solve this proble ?

regatds
Aravind

推荐答案

你没有必要专门为页面的每个saparate控件使用document.getElementById,我想建议你,如果你有限制的没有然后你可以使用每个的saparate样式表代码。

你说什么?!
you have no need to used document.getElementById specially for each saparate contral of the page, i would like to suggest you that if you have limited no of contrals then you could use the saparate stylesheet code for each one.
What you say?!


这篇关于如何使用css在链接按钮中用颜色更改下划线?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆