O'Reilly logo

Drupal 7 Webform Cookbook by Douglas Vernon Denny

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding custom CSS

The magic of CSS allows us to apply a variety of styling to the elements that make up our forms. This flexibility applies equally to all HTML elements of the same type across our entire website or may be focused on one particular element on one particular form only.

How to do it...

In just a few simple steps, we will learn how to change the presentation of our forms to suit our needs:

  1. Firstly, so that we keep ourselves organized, we create a new folder to house our custom CSS files by creating a folder named css in sites/all/themes/speakers so that we have sites/all/themes/speakers/css.
  2. To create a CSS file we open a blank file in our text editor and enter the following code:
    fieldset { border: 3px dashed; } legend { font-size: 1em; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required