[英]Form doesn't align properly on Safari but works well on Chrome
I have a form that works well on Chrome but it wrap
to on Safari in my Ruby on Rails application. 我有一个可以在Chrome上正常运行的表单,但是可以在Ruby on Rails应用程序中的Safari上
wrap
。
Here is the code 这是代码
.panel.panel-primary
.panel-heading
h4.panel-title = t('admin.statistic.filter')
.panel-body
= form_for form_target, url: url, html: {method: :get, class: 'form-horizontal', :autocomplete => 'off'} do |f|
.row
.col.col-xs-3
= f.datagrid_label :currency
= f.datagrid_filter :currency, class: "form-control"
.col.col-xs-3
= f.datagrid_label :state
= f.datagrid_filter :state, class: "form-control"
.col.col-xs-3
= f.datagrid_label :type
= f.datagrid_filter :type, class: "form-control"
.col.col-xs-6
= f.datagrid_label :created_at
.form-inline # This is what I used to make it work well on Chrome, but doesn't work on Safari
= f.datagrid_filter :created_at, class: "form-control"
.col.col-xs-2
= f.submit t('datagrid.form.submit'), class: "btn btn-primary", style: "width: 100%"
.col.col-xs-2
= link_to t('datagrid.form.clear'), {:controller => 'admin/statistic/orders', :action => 'show'}, class: 'btn btn-primary', style: "width: 100%"
Chrome Look 镀铬外观
Safari Look Safari外观
.form-inline
Is what I used to make it work well on Chrome, but doesn't work on Safari .form-inline
是我用来使其在Chrome上正常运行的功能,但在Safari上却无法运行
How can I fix this? 我怎样才能解决这个问题?
可能要检查https://browserstrangeness.bitbucket.io/css_hacks.html#webkit显示可能有助于解决此问题的媒体查询
After reading through grid columns
in bootstrap, I figured there is not reason my code should not work well on the two browsers. 在引导程序中阅读了
grid columns
之后,我认为没有理由我的代码不能在两种浏览器上正常工作。 The problem being that Safari calculates differently. 问题是Safari的计算方式不同。
So, I figured out grid column
already past 12 column in Bootstrap 3 and 24 in Bootstrap 4. Upon adjusting the column I feel should be smaller and extend/increased the number of the part that wrap to new line. 因此,我发现
grid column
已经超出了Bootstrap 3中的12列和Bootstrap 4中的24列。调整该列后,我感觉应该更小并且扩展/增加换行的零件数。 it works fine. 它工作正常。
In other words, I increase this part .col-xs-6
in the snippet below to .col-xs-8
, while I reduced others: 换句话说,我将下面的代码片段中的
.col-xs-6
部分增加到.col-xs-8
,同时减少了其他部分:
.col.col-xs-8
= f.datagrid_label :created_at
.form-inline # This is what I used to make it work well on Chrome, but doesn't work on Safari
= f.datagrid_filter :created_at, class: "form-control"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.