I'm trying to make it so that I have 2 divs, one on the top part of the screen with a name, and one on the bottom of the screen with some buttons. If you hover over 1 of the divs, they should both become visible. I found out about using the + and the ~ to make the second one appear while hovering over the first div, but can't find any way to do it the other way around. Here's what I have now: http://codepen.io/anon/pen/ojpqao
html:
<div class="bg">
<div class="topbar"></div>
<div class="bottombar"></div>
</div>
css:
.bg {
background-color: red;
width: 200px;
height: 200px;
}
.topbar {
width: 200px;
height: 20px;
background-color: green;
}
.bottombar {
width: 200px;
height: 20px;
background-color: green;
top: 180px;
position: absolute;
}
.topbar:hover, .bottombar:hover, .topbar:hover + .bottombar {
background-color: blue;
}