HighDots Forums  

CSS-Mouse Hover Problems

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss CSS-Mouse Hover Problems in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Douglas Burton
 
Posts: n/a

Default Re: CSS-Mouse Hover Problems - 09-01-2003 , 01:10 PM






Do you want all the links to behave the same, no matter where they are on
the page? If so, you'll just need these pseudo-class selectors:

a:link
a:visited
a:hover
a:active

You must list them in that order. Here's an article about it:
http://www.meyerweb.com/eric/css/link-specificity.html

If you want to apply different link styles to different elements on your
page, look up contextual selectors in a good css book.

Doug



"Payal_31" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
Hi!
I am having a problem with using CSS a:hover on my website. The problem is
that all the links of the page dont behave in the same manner. For Example,
on mouse hover some links change font color, some dont. The problem I think
was becoz these links were inside layers. I learnt from a tutorial that I
could have different links in different layers behave in different manners
by using the td "class" property. Now, in the bar in the bottom of DM, I was
supposed to right click on the "td" property and make the "class" point to
the particular css file. BUT when I right click on "class" the ONLY option
is "none". So I cant seem to change the "class" property. I tried changing
the Properties in "preferences" but wasnt successful. Also, tried coding the
"class" attribute in the "code" section but was unsuccessful. Could
anyonehelp me out?
Quote:
Thanks!





Reply With Quote
  #2  
Old   
Payal_31 webforumsuser@macromedia.com
 
Posts: n/a

Default CSS-Mouse Hover Problems - 09-01-2003 , 01:29 PM






Hi!
I am having a problem with using CSS a:hover on my website. The problem is that all the links of the page dont behave in the same manner. For Example, on mouse hover some links change font color, some dont. The problem I think was becoz these links were inside layers. I learnt from a tutorial that I could have different links in different layers behave in different manners by using the td "class" property. Now, in the bar in the bottom of DM, I was supposed to right click on the "td" property and make the "class" point to the particular css file. BUT when I right click on "class" the ONLY option is "none". So I cant seem to change the "class" property. I tried changing the Properties in "preferences" but wasnt successful. Also, tried coding the "class" attribute in the "code" section but was unsuccessful. Could anyonehelp me out?
Thanks!




Reply With Quote
  #3  
Old   
Dan Vendel *GOF*
 
Posts: n/a

Default Re: CSS-Mouse Hover Problems - 09-01-2003 , 03:21 PM



"Payal_31" webforumsuser (AT) macromedia (DOT) com wrote:

Quote:
Hi!
I am having a problem with using CSS a:hover on my website. The problem is that all the links of the page dont behave in the same manner. For Example, on mouse hover some links change font color, some dont. The problem I think was becoz these links were inside layers. I learnt from a tutorial that I could have different links in different layers behave in different manners by using the td "class" property. Now, in the bar in the bottom of DM, I was supposed to right click on the "td" property and make the "class" point to the particular css file. BUT when I right click on "class" the ONLY option is "none". So I cant seem to change the "class" property. I tried changing the Properties in "preferences" but wasnt successful. Also, tried coding the "class" attribute in the "code" section but was unsuccessful. Could anyonehelp me out?
Thanks!



Can you show a URL to the page?
You can also go here:
http://www.mako4css.com/BasEle.htm
http://www.mako4css.com/BasDiv.htm
http://www.mako4css.com/BasClass.htm
I think these topics are related to the problem.


--
Dan Vendel - *GOF*
http://www.vendel.info
Contact me directly by clicking here:
http://contact.vendel.info
Formmail tutorial:
http://www.vendel.info/tut/formmail.html
Nested table demonstration:
http://www.vendel.info/tabletut/



Reply With Quote
  #4  
Old   
gmaq webforumsuser@macromedia.com
 
Posts: n/a

Default Re: CSS-Mouse Hover Problems - 09-01-2003 , 03:28 PM



Hi Payal,

Lets say for example you have a table cell with an id of "mycell" with a link in it:

<td id="mycell">
<a href="mypage" tabindex="1">My Link</a>
</td>

Then you could declare the link style for all the links within that cell like this in your style sheet:


#mycell a:link, #mycell a:visited {
color: #666666;
font-weight: bold;
}

#mycell a:hover {
color: #FFFFFF;
font-weight: bold;
}

Then for another cell you could do like:

<td id="myothercell">
<a href="mypage" tabindex="1">My Link</a>
</td>

#myothercell a:link, #mycell a:visited {
color: #666666;
font-weight: bold;
}

#myothercell a:hover {
color: #FFFFFF;
font-weight: bold;
}


That is all you really have to do. Even if your layer has link styles applied to them they will not be inherited by the link styles you set for the table cells within if you do like what I have shown above.


Hope that helps :-)

Gordon M




Reply With Quote
  #5  
Old   
Murray *TMM*
 
Posts: n/a

Default Re: CSS-Mouse Hover Problems - 09-01-2003 , 03:30 PM



Gordon:

Since you are using an id selector, you would only be able to use this on
that individual cell. In my opinion, a better way would be with a class
selector (allowing you to reuse it as needed). Furthermore, I would write
the CSS like this (just for efficiency) -

..mycell a:link, a:visited { blah; }
..mycell a:hover { blah2; }

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver MX
(If you *MUST* email me, don't LAUGH when you do so!)
==================
news://forums.macromedia.com/macromedia.dreamweaver - THE BEST WAY TO GET
ANSWERS
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.DreamweaverFAQ.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"gmaq" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
Hi Payal,

Lets say for example you have a table cell with an id of "mycell" with a
link in it:

td id="mycell"
a href="mypage" tabindex="1">My Link</a
/td

Then you could declare the link style for all the links within that cell
like this in your style sheet:


#mycell a:link, #mycell a:visited {
color: #666666;
font-weight: bold;
}

#mycell a:hover {
color: #FFFFFF;
font-weight: bold;
}

Then for another cell you could do like:

td id="myothercell"
a href="mypage" tabindex="1">My Link</a
/td

#myothercell a:link, #mycell a:visited {
color: #666666;
font-weight: bold;
}

#myothercell a:hover {
color: #FFFFFF;
font-weight: bold;
}


That is all you really have to do. Even if your layer has link styles
applied to them they will not be inherited by the link styles you set for
the table cells within if you do like what I have shown above.
Quote:

Hope that helps :-)

Gordon M





Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.