.NETGURU
anchor link style
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngclient' list.


John Tyson
-- Moved from [aspngfreeforall] to [aspngclient] by Marcie Jones <Click here to reveal e-mail address> --

Hi,

I'm having a heck of a time making the style of my links perform the way
I want them to.

In my style sheet I have the following:

a:active {color: #000000; text-decoration: underline;}
a:link {color: #000000; text-decoration: underline;}
a:hover {color: #cc0000; text-decoration: none;}
a:visited {color: #000000; text-decoration: underline;}

And these are the html link controls in my .aspx page:

<a id=3D"LnkAbout" href=3D"AboutUs.aspx" runat=3D"server">About Us</a> =
<a
id=3D"LnkLocations" href=3D"Locations.aspx" =
runat=3D"server">Locations</a> <a
id=3D"LnkPatSvcs" href=3D"PatientSvcs.aspx" =
runat=3D"server">Services</a> <a
id=3D"LnkPTtools" href=3D"PT_Tools.aspx" runat=3D"server">Tools</a>

I want the links to be black and underlined except when the user's
cursor hovers over them, when they would appear red and not underlined.
For some reason it seems the a:hover style is not working.

I chose to use html controls for these links because I was not doing
anything programmatically with them required increased functionality. =20

Can anyone help me with this, or show me an alternative way of
accomplishing my desired effects using asp:Hyperlink web control?

Any help is very much appreciated.

Thank you,

John

Reply to this message...
 
    
Peter Brunone
John,

    If you're viewing this in Netscape (well, 4.x, anyway), you're not going to
see a hover change. For IE, you only need to define the A and A:hover
classes if you just want standard link and hover behavior.

Regards,

Peter

|-----Original Message-----
|From: John Tyson [mailto:Click here to reveal e-mail address]
|
|Hi,
|
|I'm having a heck of a time making the style of my links perform the way
|I want them to.
|
|In my style sheet I have the following:
|
|a:active {color: #000000; text-decoration: underline;}
|a:link {color: #000000; text-decoration: underline;}
|a:hover {color: #cc0000; text-decoration: none;}
|a:visited {color: #000000; text-decoration: underline;}
|
|And these are the html link controls in my .aspx page:
|
|<a id=3D"LnkAbout" href=3D"AboutUs.aspx" runat=3D"server">About Us</a> =
|<a
|id=3D"LnkLocations" href=3D"Locations.aspx" =
|runat=3D"server">Locations</a> <a
|id=3D"LnkPatSvcs" href=3D"PatientSvcs.aspx" =
|runat=3D"server">Services</a> <a
|id=3D"LnkPTtools" href=3D"PT_Tools.aspx" runat=3D"server">Tools</a>
|
|I want the links to be black and underlined except when the user's
|cursor hovers over them, when they would appear red and not underlined.
|For some reason it seems the a:hover style is not working.
|
|I chose to use html controls for these links because I was not doing
|anything programmatically with them required increased functionality. =20
|
|Can anyone help me with this, or show me an alternative way of
|accomplishing my desired effects using asp:Hyperlink web control?
|
|Any help is very much appreciated.
|
|Thank you,
|
|John

Reply to this message...
 
    
Andy Smith
on the topic of anchor pseudo selectors...

anybody know how to set those styles right on the tag?
like, how would I define a hover color for a link in the style attribute =
of the tag?

__
Andy Smith
Keyboard Jockey #3a7-2.78.1

[Original message clipped]

Reply to this message...
 
    
Peter Brunone

    I don't know of any way to assign individual hover pseudoclasses with the
style tag -- and the MSDN docs don't seem to indicate any -- but I do know
that you can accomplish the same effect with the onMouseOver and onMouseOut
event handlers.

    If you're determined to use :hover, I suppose you could create as many
classes as you have links, and then create a :hover pseudoclass for each
one. Either approach will have basically the same result, though.

-Peter

|-----Original Message-----
|From: Andy Smith [mailto:Click here to reveal e-mail address]
|
|on the topic of anchor pseudo selectors...
|
|anybody know how to set those styles right on the tag?
|like, how would I define a hover color for a link in the style
|attribute of the tag?
|
|__
|Andy Smith
|Keyboard Jockey #3a7-2.78.1
|
|
|> -----Original Message-----
|> From: Peter Brunone [mailto:Click here to reveal e-mail address]
|>
|> John,
|>
|>     If you're viewing this in Netscape (well, 4.x, anyway),
|> you're not going to
|> see a hover change. For IE, you only need to define the A and A:hover
|> classes if you just want standard link and hover behavior.
|>
|> Regards,
|>
|> Peter
|>
|> |-----Original Message-----
|> |From: John Tyson [mailto:Click here to reveal e-mail address]
|> |
|> |Hi,
|> |
|> |I'm having a heck of a time making the style of my links
|> perform the way
|> |I want them to.
|> |
|> |In my style sheet I have the following:
|> |
|> |a:active {color: #000000; text-decoration: underline;}
|> |a:link {color: #000000; text-decoration: underline;}
|> |a:hover {color: #cc0000; text-decoration: none;}
|> |a:visited {color: #000000; text-decoration: underline;}
|> |
|> |And these are the html link controls in my .aspx page:
|> |
|> |<a id=3D"LnkAbout" href=3D"AboutUs.aspx"
|> runat=3D"server">About Us</a> =
|> |<a
|> |id=3D"LnkLocations" href=3D"Locations.aspx" =
|> |runat=3D"server">Locations</a> <a
|> |id=3D"LnkPatSvcs" href=3D"PatientSvcs.aspx" =
|> |runat=3D"server">Services</a> <a
|> |id=3D"LnkPTtools" href=3D"PT_Tools.aspx" runat=3D"server">Tools</a>
|> |
|> |I want the links to be black and underlined except when the user's
|> |cursor hovers over them, when they would appear red and not
|> underlined.
|> |For some reason it seems the a:hover style is not working.
|> |
|> |I chose to use html controls for these links because I was not doing
|> |anything programmatically with them required increased
|> functionality. =20
|> |
|> |Can anyone help me with this, or show me an alternative way of
|> |accomplishing my desired effects using asp:Hyperlink web control?
|> |
|> |Any help is very much appreciated.
|> |
|> |Thank you,
|> |
|> |John
|>

Reply to this message...
 
    
Will Currie
Just try removing the visited style

-----Original Message-----
From: Peter Brunone [mailto:Click here to reveal e-mail address]
Sent: 11 July 2002 02:06
To: aspngclient
Subject: [aspngclient] RE: anchor link style

    I don't know of any way to assign individual hover pseudoclasses
with the
style tag -- and the MSDN docs don't seem to indicate any -- but I do know
that you can accomplish the same effect with the onMouseOver and onMouseOut
event handlers.

    If you're determined to use :hover, I suppose you could create as
many
classes as you have links, and then create a :hover pseudoclass for each
one. Either approach will have basically the same result, though.

-Peter

|-----Original Message-----
|From: Andy Smith [mailto:Click here to reveal e-mail address]
|
|on the topic of anchor pseudo selectors...
|
|anybody know how to set those styles right on the tag?
|like, how would I define a hover color for a link in the style
|attribute of the tag?
|
|__
|Andy Smith
|Keyboard Jockey #3a7-2.78.1
|
|
|> -----Original Message-----
|> From: Peter Brunone [mailto:Click here to reveal e-mail address]
|>
|> John,
|>
|>     If you're viewing this in Netscape (well, 4.x, anyway),
|> you're not going to
|> see a hover change. For IE, you only need to define the A and A:hover
|> classes if you just want standard link and hover behavior.
|>
|> Regards,
|>
|> Peter
|>
|> |-----Original Message-----
|> |From: John Tyson [mailto:Click here to reveal e-mail address]
|> |
|> |Hi,
|> |
|> |I'm having a heck of a time making the style of my links
|> perform the way
|> |I want them to.
|> |
|> |In my style sheet I have the following:
|> |
|> |a:active {color: #000000; text-decoration: underline;}
|> |a:link {color: #000000; text-decoration: underline;}
|> |a:hover {color: #cc0000; text-decoration: none;}
|> |a:visited {color: #000000; text-decoration: underline;}
|> |
|> |And these are the html link controls in my .aspx page:
|> |
|> |<a id=3D"LnkAbout" href=3D"AboutUs.aspx"
|> runat=3D"server">About Us</a> =
|> |<a
|> |id=3D"LnkLocations" href=3D"Locations.aspx" =
|> |runat=3D"server">Locations</a> <a
|> |id=3D"LnkPatSvcs" href=3D"PatientSvcs.aspx" =
|> |runat=3D"server">Services</a> <a
|> |id=3D"LnkPTtools" href=3D"PT_Tools.aspx" runat=3D"server">Tools</a>
|> |
|> |I want the links to be black and underlined except when the user's
|> |cursor hovers over them, when they would appear red and not
|> underlined.
|> |For some reason it seems the a:hover style is not working.
|> |
|> |I chose to use html controls for these links because I was not doing
|> |anything programmatically with them required increased
|> functionality. =20
|> |
|> |Can anyone help me with this, or show me an alternative way of
|> |accomplishing my desired effects using asp:Hyperlink web control?
|> |
|> |Any help is very much appreciated.
|> |
|> |Thank you,
|> |
|> |John
|>

| [aspngclient] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/aspngclient.asp = JOIN/QUIT

Reply to this message...
 
 




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification