HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
Table Rollovers
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Table
View previous topic :: View next topic  
Author Message
XYR0c



Joined: 01 Nov 2004
Posts: 3
Location: The inner core

PostPosted: Mon Nov 01, 2004 4:57 pm     Table Rollovers Reply with quote

Hello, I am a bit of a novice to this coding and I have some questions.
First off, I have seen on many sites, the use of tables with solid color mouse over rollovers that are used in a table that already has a background image. Am I not explaining this good enough? Well here is an example.
Take the Lava soft homepage http://www.lavasoftusa.com/ . Notice the navigation bar on the left side. Notice how each link has a table rollover that will appear over the table background image. In addition, notice that it is possible to click anywhere in the individual table for it to activate the link.

How is this possible, I looked at the html of the frame source page, but once I tried to duplicate the effect, it did not work, is this because the site runs PHP? Is there a HTML equivalent for this effect?


thank you for your time.
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8316
Location: Castle Pines North, CO USA

PostPosted: Tue Nov 02, 2004 2:59 pm     Reply with quote



You can use CSS. I have used it here on http://www.dryheatresorts.com

in the CSS - use something like:
Code:
.navCellOff
{
   BACKGROUND-COLOR: #000000;
    color:#0000FF;
}
.navCellOn
{
   BACKGROUND-COLOR: #0000FF;
    color:#000000;
}

And then in your HTML code:
Code:
         <tr>
            <td class="navCellOff" onmouseout="this.className='navCellOff';" onmouseover="this.className='navCellOn';" align="center">
            <a href="/about_palm_springs.asp">About Palm Springs</a></td>
         </tr>
XYR0c



Joined: 01 Nov 2004
Posts: 3
Location: The inner core

PostPosted: Fri Nov 05, 2004 5:45 pm     Reply with quote

when you say "In the CSS, what do you mean, where would i put that code? and would that still work if i replaced the hex value with an {img src=} to display an image for the background when in the "navcelloff" state?
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8316
Location: Castle Pines North, CO USA

PostPosted: Fri Nov 05, 2004 7:07 pm     Reply with quote

You could try background-url. You might want to take a look at:
http://www.w3schools.com/css/

The code would go in the <HEAD>:
Code:
<style type="text/css">
.navCellOff
{
   BACKGROUND-COLOR: #000000;
    color:#0000FF;
}
.navCellOn
{
   BACKGROUND-COLOR: #0000FF;
    color:#000000;
}
</style>
XYR0c



Joined: 01 Nov 2004
Posts: 3
Location: The inner core

PostPosted: Sat Nov 06, 2004 12:17 pm     Reply with quote

i just cant seem to thank you enough for the link to that site, i ... i think im going to cry. Smile
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8316
Location: Castle Pines North, CO USA

PostPosted: Sat Nov 06, 2004 1:01 pm     Reply with quote

Glad I could help. Good luck with the site!!
mikson



Joined: 07 Apr 2005
Posts: 7

PostPosted: Thu Apr 07, 2005 8:33 pm     Reply with quote

how about doing it with changing text color also what i would like to do is rollover from white to black and text from black to white Very Happy
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8316
Location: Castle Pines North, CO USA

PostPosted: Fri Apr 08, 2005 4:23 am     Reply with quote

mikson wrote:
how about doing it with changing text color also what i would like to do is rollover from white to black and text from black to white Very Happy

Did the roll-overs work with you on the font colors?
mikson



Joined: 07 Apr 2005
Posts: 7

PostPosted: Fri Apr 08, 2005 6:38 am     Reply with quote

when u rollover over the table not over the link font color doesnt change
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8316
Location: Castle Pines North, CO USA

PostPosted: Fri Apr 08, 2005 11:35 am     Reply with quote

If it is a link, you might need to set up the links as well in your CSS.
mikson



Joined: 07 Apr 2005
Posts: 7

PostPosted: Fri Apr 08, 2005 12:27 pm     Reply with quote

i know but when there is a table rollover it changes bgcolor of a table but doesnt do anything to link as far as ur mouse isnt over link color of the link wont change Razz for example if u have white page and links are on black and when u try to do rollover table to change bg color to black and link rollover to white when ull rollover over the table only bgcolor of a table will change to black so u wont see link =) i hope u understanded it
degsy



Joined: 23 Feb 2005
Posts: 2440
Location: North East, UK

PostPosted: Fri Apr 08, 2005 1:52 pm     Reply with quote

With CSS2 you can assign the :hover pseudo class to elements, such as table cells.

It will look good in Mozilla etc., but you'll find that IE doesn't support it.

In IE you would have to use javascript onmouseover to change the table cell class.
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Table All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial