473,549 Members | 2,935 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Underlining text, changing colors

How can I change the text in a link, originally displayed with the
"text-decoration:none " attribute to display an underline during the
onMouseOver event, and back to its original (non-underlined) state for
the onMouseOut? I'm pretty sure that it's of the format

document.<itemn ame>.attribute = value

but beyond that I'm not sure, and I can't find enough of a reference to
let me proceed. I'd also like, as an alternative, to be able to change
the font color instead of (or in addition to) just changing to underlining.

I'd appreciate it very much if anyone can provide a bit of code, or can
point me to some on-line reference that shows this. Thanks!
Henry
Jul 23 '05 #1
6 2364
Henry wrote:
How can I change the text in a link, originally displayed with the
"text-decoration:none " attribute to display an underline during the
onMouseOver event, and back to its original (non-underlined) state for
the onMouseOut?


<style type="text/css">
a:hover {
text-decoration: underline;
}
</style>

Mick
Jul 23 '05 #2

Thanks, Mick, for the speedy reply. I haven't used CSS before (I've had
some minor exposure to them, and I know that I should be using them...)
so I have a couple of questions.

First, does it matter where this snippet is placed on the HTML page? I
tried it in several locations (just inside the BODY and HTML tags, as
well as inside a <Table></TABLE>, but no soap.

Does it matter that the page where I'm trying to implement this is part
of a frameset? I have a links page (the left-most frame) where I want
this to be in effect.

Second- does the page's extension matter? Not only is this page part of
a frameset, it is also a JSP page. (Aha, the truth comes out!) Could
this be a factor, as well?

Certainly these effects are not crucial, but they are, I believe, pretty
understated and can give the page a more polished look. I'd like to get
this working, and appreciate your help.
Henry

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 23 '05 #3
Mick White wrote:
a:hover {
text-decoration: underline;
}


But be warned, modern browsers will also display this effect for <a>s
with only a "name" or "id" attribute.

Jul 23 '05 #4
Henry Hayden wrote:
Thanks, Mick, for the speedy reply. I haven't used CSS before (I've had
some minor exposure to them, and I know that I should be using them...)
so I have a couple of questions.

First, does it matter where this snippet is placed on the HTML page? I
tried it in several locations (just inside the BODY and HTML tags, as
well as inside a <Table></TABLE>, but no soap.
Inside <head> tags is preferred.
Does it matter that the page where I'm trying to implement this is part
of a frameset? I have a links page (the left-most frame) where I want
this to be in effect.

Second- does the page's extension matter? Not only is this page part of
a frameset, it is also a JSP page. (Aha, the truth comes out!) Could
this be a factor, as well? This should not matter
Certainly these effects are not crucial, but they are, I believe, pretty
understated and can give the page a more polished look. I'd like to get
this working, and appreciate your help.
Take a look:
http://www.mickweb.com/demo/hover.html

Mick

Henry

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 23 '05 #5
Thanks again!

I found, with the help of your last hint, what the problem was. In each
link, I had the following:

style: text-decoration: none

So... it was always going to be just that... none.
However, using the following:

<style type="text/css">
a{
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
</style>

works just fine. Thanks again!

Henry
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 23 '05 #6
Keith Bowes wrote:
Mick White wrote:
a:hover {
text-decoration: underline;
}


But be warned, modern browsers will also display this effect for <a>s
with only a "name" or "id" attribute.


Which is why you want to use

a:link:hover, a:visited:hover {
...
}

and the like. F'up2 comp.infosystem s.www.authoring.stylesheets.
PointedEars
Jul 23 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3731
by: GujuBoy | last post by:
i have a ansi.py file that i use in LINUX to change the text color to STDOUT when i use the "print" function...but when i move this ansi.py file over the windows...it does not work is there a version of ansi.py i can use for windows/linux.... please help
4
3625
by: Nick Calladine | last post by:
I have a table which has a drop down list in cell ; a image in another cell and a description in the third cell when the page is displayed it has a default picture and default text when the drop down box is changed it goes to a function to update the image which works how would i do this with a text variable ? i have defined a div or...
25
4304
by: madsgormlarsen | last post by:
Hi I am making a tab menu with css, and the tabs changes color depending on wich tab is current. 1. I could load a different css file for each tab/color. 2. I could do some inline css only for the color of the tabs. (which I would then change with trough php). 3. I could make a different class for each color, and change the class of the...
1
1172
by: jhickers | last post by:
In MS 2003 or 2002 can anyone tell me the simplist way to change color of text in a form or report? I want the values of currency fields changed to red if the amount is >= to $1,000. I am not a programmer! Thanks
3
1143
by: Vinay | last post by:
Hi All: I'd like to fill a set of controls with colors (by probably setting control.backcolor) that are changing gradually - e.g. start from dark green and endup with lightgreen. How can I do this? I suppose I will need to use the Hex values for the colors? Any help will be much appreciated!
0
764
by: mihir.kotwal | last post by:
Code: oWord.ActiveDocument.Range.InsertAfter(defword) oWord.ActiveDocument.Range.InsertAfter(" -" & defdef & vbNewLine) How can I get the defword to be underlined while leaving the rest without an underline? Thanks in advance. -Mihir
3
1468
by: Manil | last post by:
Hi, I am new to the forum. I wanted to know if there's any way in which I can underline a phrase in a webpage using CSS. I tried using "text-decoration:underline;" but it looks like that works only with hyperlinks. Any suggestions/advice is greatly appreciated. Thanks...
8
4405
by: questionit | last post by:
How in a TextBox , lines of text can be displayed, each with different colors ?
0
7518
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7446
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7715
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7469
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6040
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5368
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3498
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1935
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1057
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.