Jump to content

Parent/sibling Selectors?


casper3912

Recommended Posts

myspace doesn't allow users to implement javascript. so i'm trying to find a way to use only css to display a section based off of a clicked link. i'm curious if theres a way to change the class of a visited link to non-visited(so that it can be hidden again), and also if theres a way to relate a link in an unordered list to a div that is a sibling to the unordered list.right now all i have is this:

/*first idea, doesn't work in IE*/div{display:none;}a:visited + div {display:block;}/*second idea, this allows it to be hidden again at least */a {text-decoration:none;}a span{display:none;}a:hover span{display:block;}/*third idea*/a {text-decoration:none;}a span {display:none;}a:visited span{display:block}

hmmm... and i just got another idea. i'll post it if it goes well.

Link to comment
Share on other sites

this does exactly what i want it to do in IE, in fire fox the span isn't displayed as none for some reason, and when you mouse over it, the span that is supposed to be display none, has a interesting flutter effect. CSS

ul li a{text-decoration:none;}ul li a span {display:none;}ul li a:hover span{display:block;position:absolute; top:20%; left:30%;}

HTML

<ul><li>4th idea </li><li><a href="#">test me<span>testing 4th idea</span></li></ul>

any idea why its not working correctly in fireFox? and how i can fix it.

Link to comment
Share on other sites

ok, thanks i forgot the closing tag. it does help. i find typing out the problems i'm having to you guys, help me solve them myself, sometimes right after i type something and post it, i get an idea or figure it out myself. i think its just the process of making it presentible and going through it throughly enough that someone else could understand it, it makes me look at it 10 times and in a different perspective and mode of thought.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...