I have a lineup of 5 div boxes, and whenever you hover over one, it expands to fill the width of the screen.
The default width of the blue div is set to cover the whole screen, allowing for the application of CSS to shrink it when hovering over the other divs as it is placed last in the HTML:
#green{
width:20px;
}
#blue{
width:100%;
}
#green:hover{
width:100%
}
#green:hover ~ #blue{
width:20px;
}
Is there a method to keep a div box expanded after it is no longer being hovered over? For instance, if the orange div was open and then the cursor moved off it without going to another colored div, could it retain its full width? Currently, when the cursor moves away, the divs revert back to blue.
Furthermore, can this be achieved without using any scripting language?