与 <input type="radio>> 一起使用的良好 HTML 和 CSS?良好、input、type、lt

2023-09-06 22:07:37 作者:柠檬不该羡慕西瓜的甜

在 HTML 中使用 <input type="radio"> 的最佳方式是什么?

What's the best way to use <input type="radio"> in HTML?

我正在寻找语义良好的 HTML,其格式可通过 CSS 配置.

I'm looking for HTML that's semantically good, whose formatting is configurable via CSS.

我希望能够对其进行样式/渲染,使其看起来像:

I want to be able to style/render it to look something like:

    Car: (o) Yes
         (X) No
         (o) Maybe

  Train: (o) Yes
         (o) No
         (X) Maybe

Address: [An input text box     ]

考虑到 CSS,我想我希望左侧的标签(例如汽车"和公共汽车")位于某种 text-align: right 块中?

Thinking of the CSS, I think that I'd like the labels on the left (e.g. "Car" and "Bus") to be in some kind of text-align: right block?

我不知道右边的单选按钮:在某种 <span> 中,也许是 "display: inline-block"?还是 "white-space: pre"?

I don't know about the radio buttons on the right: in some kind of <span> perhaps, with "display: inline-block"? Or "white-space: pre"?

什么样的块级标签(例如 <p><div>)和/或其他标签(例如