views:

41

answers:

3

I want to set border color of field set. I am using class but this is not working properly because i want to remove fieldset default border color. so how can I use fieldset border color.

<fieldset class="field_set">
    <legend>box</legend>
     <table width="100%" border="0" cellspacing="0" cellpadding="0">
           <tr>
               <td>&nbsp;</td>
           </tr>
      </table>
</fieldset>

css

.field_set{
 border-color:#F00;
}
+1  A: 

It does appear red on Firefox and IE 8. (Result: http://jsbin.com/eceda4) But perhaps you need to change the border-style too.

.field_set{
    border-color:#F00;
    border-style: solid;
}

alt text

KennyTM
+1  A: 

It works for me when I define the complete border property. (JSFiddle here)

.field_set{
 border: 1px #F00 solid;
}​

the reason is the border-style that is set to none by default for fieldsets. You need to override that as well.

Pekka
A: 

If you don't want 3D border use:

border:#f00 1px solid;
cps7