html - HTML 中是否有任何标签或元素可以执行如下图所示的操作:
解决方案
<fieldset>
和<legend>
元素可以做到这一点。
legend {
margin: 0 auto;
}
input {
width: 100%;
}
<form>
<fieldset>
<legend>Comment</legend>
<input type="text" placeholder="Add your comment"/>
</fieldset>
</form>
推荐阅读
- python - 如何在子包中导入模块?
- python - Excel 工作表中的数据排序
- python - 如何在二维布朗运动模拟中直观地表示时间演化
- ios - 如何将 Thrift 0.12 导入 Xcode 以支持 Swift 4.2
- ios - snapshotView(afterScreenUpdates:true) 在真实设备上运行时返回空视图
- c# - 为什么在 MVC 之外使用 ValidationContext 时未验证 StringLength?
- java - 如何根据标准使用 Java 8 流删除重复项
- node.js - 节点未重定向到页面未找到 404
- ruby-on-rails - Rails 未从此操作返回
- python - 调试 python django 项目