It should work. I just tested it; your greenish background color for forms is properly rendered. The problem is: you did not provide your HTML sample, so who knows what have you written to use this CSS.
However, you are not using the best approached. First of all,
form
if not really a rendered element. It is used to group the input controls participating in the HTTP request. So, instead of form, apply your class for some other element:
table
itself, or, if you want, to some
div
with a class name.
One more important improvement: in most cases, instead of
body { }
write:
body, html { }
If you don't include "html" element, it can be possible, with some rendering engines, to render some border of different color around the body. Usually, you don't want that.
Also, you need to remember that CSS means
Cascading Style Sheet, so you can use cascading. If you have style for
div
, you elements
div.someClass
will inherit the style properties of
div
, so you can add only the differences to some special
div
element, segregated by classes, pseudo-classes, ids, etc.
—SA