HTML Form How to - Define fieldset border color








Question

We would like to know how to define fieldset border color.

Answer


<!DOCTYPE html>
<html>
<body>
  <fieldset style="border: 2px solid #F37622; width: 10px">
    <legend>box</legend>
    <table>
      <tr>
        <td><label>xxxxx</label></td>
        <td><input type="text" /></td>
        <td><label>x</label></td>
        <td><input type="text" /></td>
        <td><label>xxxxx</label></td>
        <td><input type="text" /></td>
      </tr>
    </table>
  </fieldset>
</script><!--   w w  w  .  j a  v  a  2 s  .co m-->
</body>
</html>

<!--
<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
.field_set {
  border: 1px #F00 solid;
}
</style>
</head>
<body>
  <fieldset class="field_set">
    <legend>box</legend>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td>labal</td>
      </tr>
    </table>
  </fieldset>
</body>
</html>

-->

The code above is rendered as follows: