如何使表单响应?

时间:2014-11-11 03:06:39

标签: css ruby-on-rails forms twitter-bootstrap responsive-design

表单当前以较小的分辨率挂在边框上。在下面代码的顶行,我能够使用
将表格准确定位在我想要的位置 " margin-left:-30%"。定位仅适用于我的笔记本,并且在平板电脑或手机上测试时无法响应。

这里的参考项目=> solanosprinklers.net

这是表单文件...... layouts / index

  <%= form_for @customer, :html => { :class => 'form-horizontal',:style =>'margin-left:-30%; position:absolute'} do |f| %>
    <div class="control-group">

    <div class="controls">
      <%= f.text_field :cust_fname, :class => 'text_field',:style => 'float: left', :placeholder =>"First Name" %>
    </div>
    </div>
    <div class="control-group">

    <div class="controls">
      <%= f.text_field :cust_lname, :class => 'text_field', :placeholder =>"Last Name" %>
    </div>
    </div>
    <div class="control-group">

    <div class="controls">
      <%= f.text_field :cust_phone, :class => 'text_field', :placeholder =>"Phone" %>
    </div>
    </div>
    <div class="control-group">

    <div class="controls">
      <%= f.text_field :cust_email, :class => 'text_field', :placeholder =>"Email" %>
    </div>
    </div>

    <div class="control-group">

    <div class="controls">
      <%= f.radio_button :cust_property,'Residential', :class => 'radio_button' %> Residential
      <%= f.radio_button :cust_property,'Commercial', :class => 'radio_button' %> Commercial
    </div>
    </div>
    <div class="control-group">

    <div class="controls">
      <%= f.text_area :cust_notes, :class => 'text_area', :placeholder =>"How can we help ?" %>
    </div>
    </div>

    <div class="">
    <%= f.submit "Send", :class => 'btn btn-primary',:style => "background:green; margin-left:55%" %>

    </div>
<% end %>

这是表单呈现的主页/索引文件

<div class="container">
    <div class="row">
        <div class="span4">
            <div style="border: 5px solid;border-radius: 15px">
                <h3 style="text-align:center">Let us know how we can help</h3>
                <hr>
                 <div > 
                    <%= render "layouts/indexform"%>
                </div>
            </div>
        </div>
        <div class="span5">
            <div>
            <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem. Investigationes demonstraverunt lectores legere me lius quod ii legunt saepius. Claritas est etiam processus dynamicus, qui sequitur mutationem consuetudium lectorum. Mirum est notare quam littera gothica, quam nunc putamus parum claram, anteposuerit litterarum formas humanitatis per seacula quarta decima et quinta decima. Eodem modo </p>
            </div>
        </div>
        <div class="span3">
            <div>
            <%= image_tag 'Sprinkler2.png' %>
            </div>
        </div>
    </div>
</div>
<div class="container">
    <div>
        <hr>
        <div style="text-align:center">
            <h3>Our Preferred Systems</h3>
        </div>
    </div>
    <div class="row">
        <div class="span4" style="padding-bottom:10px">
            <%= image_tag 'rainbird.png' %>
        </div>

        <div class="span4" style="padding-bottom:10px">
            <%= image_tag 'toro.png' %>
        </div>

        <div class="span4" style="padding-bottom:10px">
            <%= image_tag 'hunter.png' %>
        </div>
    </div>
</div>

0 个答案:

没有答案