Torrentes
asked on
asp:Hyperlink wiht CSS
Hi,
Im trying to get the Hyperlink to look like the regular links.
By regular I mean to have the little hand when you move the mose over it and to change color after you click on it. But, on IE it does not work. I cant us the NavigateUrl because Im using on the behind code with javascript to sent it with some values to another page.
If you need more info please let me know.
<style type="text/css">
A.Link
{ text-decoration: underline }
A.Link:active
{ text-decoration: none }
A.Link:hover
{
color: blue;
text-decoration: underline;
}
</style>
<asp:Hyperlink ID="test" runat="server" Text="My Page" CssClass="Link" ></asp:Hyperlink>
Thank you,
Im trying to get the Hyperlink to look like the regular links.
By regular I mean to have the little hand when you move the mose over it and to change color after you click on it. But, on IE it does not work. I cant us the NavigateUrl because Im using on the behind code with javascript to sent it with some values to another page.
If you need more info please let me know.
<style type="text/css">
A.Link
{ text-decoration: underline }
A.Link:active
{ text-decoration: none }
A.Link:hover
{
color: blue;
text-decoration: underline;
}
</style>
<asp:Hyperlink ID="test" runat="server" Text="My Page" CssClass="Link" ></asp:Hyperlink>
Thank you,
Your link is not acting correctly because it has no URL or HREF
Set the NavigateURL to '#'
Set the NavigateURL to '#'
The behavior you required in your question is actually the default behavior of a hyper link out of box if there is no style set on it. So just remove your hyper link style and let browser to handle the rest.
1. Don't define "CssClass" for the hyper link control
2. Don't define any style for hyper link tag, such as a.link, a.visited, etc.
Then give it a try to see if the result is what you want.
1. Don't define "CssClass" for the hyper link control
2. Don't define any style for hyper link tag, such as a.link, a.visited, etc.
Then give it a try to see if the result is what you want.
ASKER
guy,
I Set the NavigateURL to '#'. But
On IE once a click the link it does not change color, to show that the link was click on.
I Set the NavigateURL to '#'. But
On IE once a click the link it does not change color, to show that the link was click on.
Create a style for A.Link:visited
Create a style for A.Link:visited
ASKER
For some reason is not working on IE
<style type="text/css">
a.Link:visited
{ color: #000000
}
</style>
<asp:Hyperlink ID="test" runat="server" Text="My Page " Visible="true" NavigateUrl='#' CssClass="Link"></asp:Hype rlink>
<style type="text/css">
a.Link:visited
{ color: #000000
}
</style>
<asp:Hyperlink ID="test" runat="server" Text="My Page " Visible="true" NavigateUrl='#' CssClass="Link"></asp:Hype
Torrentes, Just an FYI, I am looking into this...
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Thank you for taking your time to answer my question.
.OverLink
{
color:Blue;
text-decoration:underline;
}
.NormalLink
{
color:Red;
text-decoration:none;
}
then use the onmouseover and onmouseout events on the HyperLink control:
<asp:HyperLink CssClass="NormalLink" onmouseover="this.classNam
There may be a cleaner, better way of doing this, but this works...