473,402 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

hover


I'm new to CSS. I have seen hover used with anchor elements to chang
the text color but can it be used with any other elements? Are ther
any other simple alternate methods of changing text color without th
use of images (like with onMouseover/onMouseout)

domece
-----------------------------------------------------------------------
Posted via http://www.forum4designers.co
-----------------------------------------------------------------------
View this thread: http://www.forum4designers.com/message46697.htm

Jul 20 '05 #1
4 3427
domeceo wrote:
I'm new to CSS. I have seen hover used with anchor elements to change
the text color but can it be used with any other elements?
Yes, but it doesn't work in IE.
Are there any other simple alternate methods of changing text color
without the use of images (like with onMouseover/onMouseout)?
You can access CSS properties via objRef.style.propertyName (converting
two-part properties to camelCase), or change the class wtih
objRef.className.
Posted via http://www.forum4designers.com


- Ugly and large sig
- non-standard sig seperator
- adverts on the pages

Try either a less evil Web-Usenet gateway: http://groups.google.com/
Or get a real NNTP account.

--
David Dorward <http://dorward.me.uk/>
Jul 20 '05 #2
Maybe stick it in a table, and give the table cell an id, and then have
a mouseover on the table cell change the bgcolor. Example follows. Question
to throw out there - is getElementById() an IE only thing? I have to admit,
I'm pretty green with the Javascript, and have only had call to write for IE
so far, and so haven't concerned myself too much with cross browser stuff.

<script>

function chBgcolor() {
document.getElementById("link1").bgColor = "FFFFFF";
return true;
}

</script>
[html]
<tr>
<td id="link1" onmouseover="chBgcolor();"><a href="link">link
text</a></td>
</tr>
"domeceo" <do************@mail.forum4designers.com> wrote in message
news:do************@mail.forum4designers.com...

I'm new to CSS. I have seen hover used with anchor elements to change
the text color but can it be used with any other elements? Are there
any other simple alternate methods of changing text color without the
use of images (like with onMouseover/onMouseout)?
domeceo
------------------------------------------------------------------------
Posted via http://www.forum4designers.com
------------------------------------------------------------------------
View this thread: http://www.forum4designers.com/message46697.html

Jul 20 '05 #3
"fenian" <fe****@start.ca> wrote:
"domeceo" <do************@mail.forum4designers.com> wrote in message
news:do************@mail.forum4designers.com...

I'm new to CSS. I have seen hover used with anchor elements to change
the text color but can it be used with any other elements? Are there
any other simple alternate methods of changing text color without the
use of images (like with onMouseover/onMouseout)?

Top posting fixed, please don't.
Maybe stick it in a table, and give the table cell an id, and then have
a mouseover on the table cell change the bgcolor.
Why does it need to be in a table?

Using .style.backgroundColor rather than .bgcolor it will work for any
element.
Question
to throw out there - is getElementById() an IE only thing?


No. It's part of the W3C DOM and is supported by IE5+, Gecko, Opera
and others. The IE only 'equivalent' is document.all

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #4
http://www.xs4all.nl/~peterned/csshover.html

Try this...

Steve Pugh wrote:
"fenian" <fe****@start.ca> wrote:
"domeceo" <do************@mail.forum4designers.com> wrote in message
news:do************@mail.forum4designers.com.. .
I'm new to CSS. I have seen hover used with anchor elements to change
the text color but can it be used with any other elements? Are there
any other simple alternate methods of changing text color without the
use of images (like with onMouseover/onMouseout)?

Top posting fixed, please don't.

Maybe stick it in a table, and give the table cell an id, and then have
a mouseover on the table cell change the bgcolor.

Why does it need to be in a table?

Using .style.backgroundColor rather than .bgcolor it will work for any
element.

Question
to throw out there - is getElementById() an IE only thing?

No. It's part of the W3C DOM and is supported by IE5+, Gecko, Opera
and others. The IE only 'equivalent' is document.all

Steve

Jul 20 '05 #5

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

Similar topics

7
by: LRW | last post by:
Below I'll paste my CSS and the HTML in question. But what's happening is, I'm trying to establish a link behavior for a class that's separate from the normal link class. I've established a: 's...
6
by: Nikolaos Giannopoulos | last post by:
If I have simplified html (I have removed height, weight, alt, etc... attributes to simplify the example) such as: <div id="header"> <a href="blah.html"><img src="img/blah.jpg"></a> </div> ...
12
by: Sander Tekelenburg | last post by:
Trying to make some images disappear on hover (works), and others appear on hover (works not). In tested browsers, this gives the expected result: IMG.disappear {visibility: visible}...
6
by: Michael Rozdoba | last post by:
I've had some trouble getting IE to behave in respect of applying absolute positioning to a span on an a:hover. I can get it to work, but I don't understand why certain code causes it to fail to...
8
by: JLahm | last post by:
I have defined a class for my images called .image that specifies the default border color, width and style. I'd like to be able to have the pseudo elements link, visited and active have one color...
15
by: Robert Mark Bram | last post by:
Hi All! Problem I began with: Netscape/Opera supports hover for different elements, IE only supports hover for <a> and I want to use hover for <td class="menu"> I then found a fix using some...
2
by: skipc | last post by:
I posted a recent message regarding navigating a table using arrow keys. I've got the code for the navigation working. My table contains rows of links (anchors). I can get to a specific link...
24
by: fehays | last post by:
Hello, I'm having a problem with the css hover effect in IE. I have an <a> tag with the following CSS: a.subNavItem { display:block; color:#464645; padding:2px 7px 4px 6px;...
7
by: Cate Archer | last post by:
I want to have a border around an image that changes color when the mouse hovers over it. The following code works perfectly in FireFox but not in Internet Exploiter. The text link changes color...
4
by: Sigilaea | last post by:
My previous post got squashed because m post is too long. Sorry for that: I have an AJAX page with a CSS menu at the top. My problem is the hover functionality stops working after someone clicks...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...

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.