FORMfields, the premiere web framework
Support Home | Knowledge Base | Documentation | Forums | Contact Us
FORMfields & FORMgen :: Formatting

Creating a New CSS Template

(3653 views. Last Updated: 2007-08-08 6:06 PM)

Here's a basic example of how to create a new CSS template. In this example we will:
1. Set the field label color to green.
2. Set the page background color to #ccffff.
3. Set the form background color to #eeffff.

To do this, we 1st create a form with FORMgen, which we will call myform.php. Next, we define a new CSS template called petersStyle.css, which implements the above style and contains:
label.isValid {
    color: green;
    background-color: inherit;

body.FORMfields {
    background-color: #ccffff;
    color: inherit;

div.FORMfields {
    background-color: #eeffff;
    color: inherit;
We then upload this file to /FORMfields/styles. Next, we edit myform.php and replace the reference to the CSS file with:
    define("FF_STYLE_FILE", FF_ROOT_URL . "/styles/petersStyle.css");

Note: For more FORMfields CSS constructs, please see /FORMfields/src/FORMfields.css and /FORMfields/styles/midnight.css.
Support | Earn Money
Copyright © 2005-2020 Brain Book Software LLC.
Built with FORMfields, the premiere web framework.