Okay so I'm a self-taught coder and I often run into things that I should understand but just.. Don't, for some reason. I keep running into this issue where I need to make it so that I can hover over one element to access another usually underneath it or in other cases I've needed it to create a nice drop down list.. Things like that. So I had a friend explain to me that I should build something using the ~ selector but I don't remember exactly how to write it or even how it works. I've looked up different demonstrations but never really understood it.
What I have is this: http://codepen.io/Peechiee/full/vEZmMY/
If you go to the bio section, I'm trying to make it so that when I hover over the GIF, it'll show the element underneath. Problem is, no matter how I try to set up the rule set, it's not working for me. I can't begin to imagine why that is since I don't know how to use this selector.
What I have for that section is this:
.bio1 {
height:50%;
width:50%;
position:absolute;
background-color:transparent;
color:#FFFFFF;
z-index:71;
top:7%;
left:0%;
overflow:hidden;
}
.bio2 {
height:50%;
width:50%;
left:0%;
top:7%;
background-color:GREY;
color:#FFFFFF;
font-family:MS Gothic;
font-size:8pt;
z-index:70;
position:absolute;
}
.bio1:hover ~ .bio2 { }
I haven't placed any declarations for that last rule set because in complete honesty I'm not even sure what that does. I was just wondering if someone could please fix this for me and maybe explain to me how this works so that I can use it in the future? By the way, for the site I'm using this on I'm not allowed to use Java so please avoid that. Thanks in advance. :D