Electronic Schematics (alt.binaries.schematics.electronic) A place to show and share your electronics schematic drawings.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to alt.binaries.schematics.electronic
external usenet poster
 
Posts: 72
Default css selectors

Is it possible to refer to an a parent element and modify its attributes?

Say I have a ul with some links in it:

ul
li
SomeText
a href="..."Link/a
/li
/ul


Now I want to change the color of SomeText depending on if a is hovered. (My
problem is more complicated than this so don't take this example at face
value... I know its easy to solve here but that is not what I'm asking)

so if I do something like

ul li a:hover
{

}

Then the style references everything in a. is there any way to tell it to
reference li instead?

I know in this example I can do it easy but in my problem I have nested ul's
and I need to change the color of a link in the first list when there is a
hover over a link in the second list(which is a sub list).

So essentially I want to change the color of a link when a completely
disjoint link is highlighted.

Is it possible with css?

Thanks,
Jon






  #2   Report Post  
Posted to alt.binaries.schematics.electronic
external usenet poster
 
Posts: 72
Default css selectors

lol. Wrong group.


  #3   Report Post  
Posted to alt.binaries.schematics.electronic
external usenet poster
 
Posts: 140
Default css selectors

On 2007-04-17, Jon Slaughter wrote:

Is it possible to refer to an a parent element and modify its attributes?


no.

Say I have a ul with some links in it:

ul
li
SomeText
a href="..."Link/a
/li
/ul


Now I want to change the color of SomeText depending on if a is hovered. (My
problem is more complicated than this so don't take this example at face
value...


there's a way to do that, but what's the real problem.

so if I do something like

ul li a:hover
{

}

Then the style references everything in a. is there any way to tell it to
reference li instead?

I know in this example I can do it easy but in my problem I have nested ul's
and I need to change the color of a link in the first list when there is a
hover over a link in the second list(which is a sub list).

So essentially I want to change the color of a link when a completely
disjoint link is highlighted.


Is it possible with css?


li.hover almost does what you want (where supported)


there's no parent selector.


http://css.maxdesign.com.au/selectutorial/
http://www.w3.org/TR/REC-CSS2/selector.html#q1

Bye.
Jasen











Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 06:55 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 DIYbanter.
The comments are property of their posters.
 

About Us

"It's about DIY & home improvement"