Give border title in div

后端 未结 4 1813
说谎
说谎 2020-12-08 09:26

Can I do like this in HTML:

\"enter

I want to add border title ("General

相关标签:
4条回答
  • 2020-12-08 09:47

    The image is possibly using a fieldset tag instead of a div, inside a fieldset you can use the tag legend and it will automatically position there.

    <fieldset>
    <legend>General Information</legend>
    </fieldset>
    
    0 讨论(0)
  • 2020-12-08 09:50

    Round Border with Background color.

    <!DOCTYPE html>
    <html>
    <head>
    <style> 
    .sample
    {
    border:2px solid #a1a1a1;
    padding:10px 40px; 
    background:#ffffdffffd;
    width:300px;
    border-radius:25px;
    }
    </style>
    </head>
    <body>
    
    <div class="sample">
    The border-radius property allows you to add rounded corners to elements.
    
    <fieldset style="width:100px;">
    
    <legend>
    
    Please Enter Your Name</legend>
    
    <br>
    
    <table>
    
    <tr>
    
    <td>First Name:</td>
    
    <td><input type="text" /></td>
    
    </tr>
    
    <tr>
    
    <td>Last Name:</td>
    
    <td><input type="text" /></td>
    
    </tr>
    
    <tr>
    
    <td>First Name:</td>
    
    <td><input type="text" /></td>
    
    </tr>
    
    <tr>
    
    <td>Last Name:</td>
    
    <td><input type="text" /></td>
    
    </tr>
    
    </table>
    
    <input type="submit" value="Submit">
    
    
    </fieldset>
    
    </div>
    </body>
    </html>
    

    This will give output like this,

    enter image description here

    0 讨论(0)
  • 2020-12-08 10:07
    <div id="form" style="width:350px;">
       <fieldset>
          <legend style="color:blue;font-weight:bold;">General Information</legend>
          <table>
             <tr>
                <td><span style="text-decoration:underline">C</span>hange Password To:</td>
                <td><input type="text"/></td>
             </tr>
             <tr>
                <td><span style="text-decoration:underline">C</span>onfirm Password:</td>
                <td><input type="text"/></td>
             </tr>
          </table>
       </fieldset>
    </div>
    
    0 讨论(0)
  • 2020-12-08 10:08
    <fieldset style="width:100px;">
    
    <legend>
    
    Please Enter Your Name</legend>
    
    <br>
    
    <table>
    
    <tr>
    
    <td>First Name:</td>
    
    <td><input type="text" /></td>
    
    </tr>
    
    <tr>
    
    <td>Last Name:</td>
    
    <td><input type="text" /></td>
    
    </tr>
    
    </table>
    
    </fieldset>
    

    This will givu u output like this.

    enter image description here

    0 讨论(0)
提交回复
热议问题