css - 如何将 CSS 样式设置为 div 使其看起来像带有标签的 GUI 控制框?

标签 css

我真的很想制作一个带有用户输入框和各种其他元素的 PHP 页面,使其看起来像您在老式 GUI 上看到的控制框,它们的边框以框标签开始和结束。

看这里: enter image description here

如何使用 css 做到这一点?

最佳答案

不要使用 div。 HTML 有 <fieldset><legend>这是为这个用例设计的,默认情况下是这样呈现的。

<fieldset>
  <legend>Motor 1 Log</legend>
  <label>Movements <input></label>
  <label>Over-Currents <input></label>
  <label>Amphous <input></label>
</fieldset>

关于css - 如何将 CSS 样式设置为 div 使其看起来像带有标签的 GUI 控制框?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18047174/

相关文章:

css - 固定位置菜单在包含在 iframe 中时不起作用

在移动设备上测试基于 Web 的应用程序时,CSS 固定顶部栏不断下降

html - Bootstrap Woocommerce 结帐列未对齐

html - 文本迫使 DIV 不保持相同的大小

css - 如何将 div 定位在另一个带有图像的 div 下方?

css - 将元素绝对定位到相对定位元素内的页面

css - 如何使用 CSS 使 simple_form 输入字段变宽?

html - <div> 和 <section> 之间的确切区别是什么?就像我知道 Section 有 'meaning' 而 div 没有,但这是什么意思?

html - 为什么在图形周围添加文字不起作用?

html - 无论我做什么,我都无法触摸表格元素