Forums

CSS; .form_element background color

samuel1376 12 Mar, 2010
How could I change the CSS to shade every-other .form_element background?

In other words, say I have mulitiple elements in my form. I want the first element to have an #FFFFFF background, the second element an #CCCCCC background, the third element an #FFFFFF background, the fourth element and #CCCCCC background and so on.

I know this is doable, does anyone know how to write the CSS?

I have modified the css for the default>css>style1.css as;

.form_element {

font-family:Arial, Helvetica, sans-serif;

font-size:14px;

float: left;

margin-left:30px;

margin-top:8px;

margin-bottom:8px;

padding-bottom: 10px;

border-bottom:1px solid #666;

width:85%;

}

Thank you in advance!
GreyHead 12 Mar, 2010
Hi samuel1376,

You could just add extra 'odd' and 'even' classes and a CSS snippet to set the background-color.

Bob
This topic is locked and no more replies can be posted.