2010-09-07 4 views
1

J'ai un fieldset et une légende. frontière fieldset arrive au milieu de la légende comme ci-dessous alt textComment définir la bordure de fieldset depuis la légende bottom?

Mais je veux frontière comme ci-dessous

alt text

ligne de frontière devrait venir en dessous de la légende.

J'utilise ci-dessous css.

.fieldSet 
{ 
    width: 97%; 
    margin-left: 10px; 
    border-color: #003366; 
} 

.legendStyle 
{ 
    border-style:none; 
    background-color: #003366; 
    font-family: Tahoma, Arial, Helvetica; 
    font-weight: bold; 
    font-size: 9.5pt; 
    Color: White; 
    width:30%; 
    padding-left:10px; 

} 

Répondre

2

essayez ceci:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> 
<html lang="en"> 
<head> 
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> 
    <title></title> 
    <style type="text/css"> 
    fieldSet 
    { 
     width: 97%; 
     margin-left: 10px; 
     border:0; 
     margin:0; 
    } 

    legend 
    { 

     border-style:none; 
     background-color: #003366; 
     font-family: Tahoma, Arial, Helvetica; 
     font-weight: bold; 
     font-size: 9.5pt; 
     Color: White; 
     width:30%; 
     padding-left:10px; 

    } 

    fieldset div { border:1px solid #003366; position:relative; top:-6px } 

    </style> 
</head> 
<body> 

    <fieldset> 
     <legend>Employee Information</legend> 
     <div> 
      <label for="x">some label</label> 
      <input type="text" name="x" /> 
     </div> 
    </fieldset> 

</body> 
</html> 
+0

Merci beaucoup – James123

Questions connexes