How can I define fieldset border color?

Kali Charan Rajput picture Kali Charan Rajput · Sep 18, 2010 · Viewed 109k times · Source

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;
}

Answer

kennytm picture kennytm · Sep 18, 2010

It does appear red on Firefox and IE 8. But perhaps you need to change the border-style too.

.field_set{
  border-color: #F00;
  border-style: solid;
}
<fieldset class="field_set">
  <legend>box</legend>
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td>&nbsp;</td>
    </tr>
  </table>
</fieldset>

alt text