在 div 中给出边框标题

新手上路,请多包涵

我可以在 HTML 中这样做吗:

在此处输入图像描述

我想在我的 div 上添加边框标题(此图像中的“一般信息”)。可能吗?怎么做?


笔记:

该图像不是 HTML 页面的图像,它是 Java 应用程序的图像。

原文由 Harry Joy 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 363
2 个回答
<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>

原文由 user554180 发布,翻译遵循 CC BY-SA 3.0 许可协议

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位置在那里。

 <fieldset>
<legend>General Information</legend>
</fieldset>

原文由 amosrivera 发布,翻译遵循 CC BY-SA 2.5 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题
logo
Stack Overflow 翻译
子站问答
访问
宣传栏