简体   繁体   English

Bootstrap的Rails Form Time_Select格式问题

[英]Rails Form Time_Select formatting problems with Bootstrap

For my time_select tag in my Rails form, the hour and date components of the field are separated by a break. 对于我的Rails表单中的time_select标记,该字段的小时和日期部分由一个中断分隔。 I would like them to be inline but no matter what I do I can't seem to achieve this. 我希望他们能够内联,但是无论我做什么我似乎都无法实现这一目标。 I've attached a picture of my code. 我已经附上了我的代码的图片。 在此处输入图片说明

You should put this in the input 您应该将此输入

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

and in the css file 并在css文件中

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

Next time, please copy and paste your code. 下次,请复制并粘贴您的代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM