Styling more usable form buttons

Last modified: August 23, 2009 - 21:19

To try and prevent clicking on destructive buttons, it might be a good practice to make the Delete button less important, yet still available. To do that, you can simply style each of the button types Drupal puts out—edit, submit and delete. Here's an example making the submit button boldest, and removing the button style of delete.

#edit-preview {
  border: 2px solid #CACC00;
  color: #A6A800;
}
#edit-submit {
  border: 2px solid #769405;
  color: #668004;
}
#edit-delete {
  background: none;
  border: none;
  color: #999;
}

Notes

If you add a margin-left of 2 or 3 em's, the delete is harder to click by accident. Also increase the font size on the submit button so the whole button is larger.

 
 

Drupal is a registered trademark of Dries Buytaert.