1) Set visible property to true
2) create a computed field with the formula: getComponent(Id of above field).getValue()
3) select source tab and enter the <div> tag before and </div> tag after your field code as below, but not to include your computed field
The reason for doing it this way is because any other way the required property doesn't evaluate to true