我试图在表单中的问题和条目之间留一点空间。这是代码。我试过了
.signup entry {
margin-top: 30 px;
}
我认为应该可以,但没有用。
我也试过为问题分配一个类
所以,
=label_tag(:email,"Email: ", class: "example")
然后
.example {
margin-bottom: 30px;
}
认为这应该有效,但仍然没有。
我做错了什么……?非常感谢您的帮助
.col-md-6.col-md-offset-3{:style=>"text-align:full; background: rgba(33, 181, 250,.68); padding-top:0px; padding-bottom: 5px; margin-bottom:10px; color: white; margin-top: 30px;"}
%br
= form_tag('/borrower_response', method:"post", class:"borrower-form") do
.row
.col-md-6
=label_tag(:name,"Name:",)
=text_field_tag(:name, nil, class: "signup-entry")
.col-md-6
=label_tag(:email,"Email: ",)
=text_field_tag(:email, nil, class: "signup-entry")
.row
.col-md-6
=label_tag(:amount,"How much are you looking to refinance or borrow?")
=text_field_tag(:amount, nil, class: "signup-entry")
.col-md-6
=label_tag(:current_rate, "What rate do you pay now, if applicable?")
=text_field_tag(:current_rate, nil, class: "signup-entry")
%br
更新:
OK 只是尝试将 %br 放在第二个 .row 之前,这成功了。有了这个,我无法准确控制我创建了多少空间 - 如果有人知道我如何使用 margin-bottom/margin-top 属性等来做到这一点,请告诉我。谢谢!
最佳答案
您在值和单位之间使用空格:margin-top: 30 px;
应该是 margin-top: 30px;
。
什么是:text-align:full;
,应该是:left
, right
or justify
关于html - 表单 CSS - 边距,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31423929/