0

对于我的 Rails 表单中的 time_select 标记,字段的小时和日期组件由一个中断分隔。我希望他们是内联的,但无论我做什么,我似乎都无法实现这一点。我附上了我的代码的图片。在此处输入图像描述

4

1 回答 1

0

你应该把它放在输入中

<%= f.label "Monday Start Time" %>
<%= f.time_select :mondaystart, {}, { class: 'time-select' } %>
<%= f.label "Monday Close Time" %>
<%= f.time_select :mondayend, {}, { class: 'time-select' } %>

并在css文件中

.time-select {
  width: 10%;
  display: inline;
}

下次,请复制并粘贴您的代码。

于 2016-09-03T23:44:43.840 回答