如何将上方的矩形文本放置在大矩形边框的中间位置?

huangapple go评论74阅读模式
英文:

How to place the upper rectangular text in the middle of the big rectangular border

问题

我知道存在一个带有写在左上角的表单HTML元素,但是其他的我不清楚。是不是我需要根据父级div在X轴和Y轴上进行翻译?

英文:

如何将上方的矩形文本放置在大矩形边框的中间位置?

I knew of the existence of a form html element with its writing in the upper left corner, but nothing more. Is it that I need to translate on X and Y axis according to the parenting div.

答案1

得分: 1

<fieldset> 元素用于在网页表单中分组内容。

<legend> 元素表示 <fieldset> 的标题。

<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-css -->
legend {
    margin: auto;
    padding: .5em;
    border: 1px solid grey;
    border-radius: 10px;
    background-color: lightgrey;
}

<!-- language: lang-html -->
<fieldset>
  <legend>绘图中心</legend>
</fieldset>

<!-- end snippet -->
英文:

The &lt;fieldset&gt; element is used to group content within a web form.

The &lt;legend&gt; element represents a caption for the &lt;fieldset&gt;.

<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-css -->

legend {
    margin: auto;
    padding: .5em;
    border: 1px solid grey;
    border-radius: 10px;
    background-color: lightgrey;
}

<!-- language: lang-html -->

&lt;fieldset&gt;
  &lt;legend&gt;Drawing Centric&lt;/legend&gt;
&lt;/fieldset&gt;

<!-- end snippet -->

huangapple
  • 本文由 发表于 2023年7月27日 14:56:36
  • 转载请务必保留本文链接:https://go.coder-hub.com/76777179.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定