0

Is there a simple way to show a commandButton when I hover an outer div?

<h:panelGroup layout="block" styleClass="galleryPreview">
      <a4j:commandButton value="Start from here" styleClass="commandButton"
      action="#{skinningBean.setCurrentSkinAndForwardToEditor(skin, false)}" />
</h:panelGroup>

So I guess I have to initially hide my buttons like visibility: hidden;

Is it possible to set all elements in my div visible on hover?

Something like

.galleryPreview:hover {
    border: 1.5px solid #6bba29;
    visibility: visible;
}
4ndro1d
  • 2,926
  • 7
  • 35
  • 65

1 Answers1

2

I just have to set the class of the commandButton to visible, not the outer div

.galleryPreview:hover .commandButton{
    visibility: visible;
}
4ndro1d
  • 2,926
  • 7
  • 35
  • 65