2

前几天我偶然发现了 Pure 项目——YUI 团队发布的一组 CSS 模块。我想标准化我网站上的表单,我喜欢他们表单模块的外观。尤其是他们称之为对齐表单的表单样式。我将 CSS 添加到我的站点并将所需的样式添加到我的表单中,除了我的单选按钮组之外,它都运行良好。在对齐表单中,每个输入在左侧都有一个标签,在它的标签右侧有一个输入。但是单个单选按钮具有单独的标签 - 其样式位于按钮的右侧。我正在寻找的是一种为左侧和居中样式的按钮组添加整体标签的方法。

我确实找到了一种解决方法,但我正在寻找一种专用的“纯”方法。

我的解决方法是在字段集中包含收音机,并使用字段集的图例作为收音机组的标签。

我很乐意听取使用 Pure Aligned Forms 的其他人的意见,看看您是如何处理这个问题的。

4

1 回答 1

0

Your question is a little vague I think. If what you are trying to achieve is something like this,

Label
  radio
  radio
  radio

then the way you did it (what you call your "workaround") is actually the best way to do this. Fieldsets are meant for grouping items together and you can use the legend as the label.

However, if you are trying to do something like this,

       radio
Label  radio
       radio

then you are going to want to use floating divs (one to hold your label and another to group your radio buttons).

I can't really get more specific without knowing what your code looks like and what you are specifically going for...

于 2014-01-04T18:48:20.100 回答