我正在使用引导程序来设置带有单选按钮的表单。
不幸的是 display:inline 没有使表单上的单选按钮内联。也没有将 display:inline 移动到 css 中。
<div class="row">
<div class="span6 offset3">
<div style="display:inline">
<%= f.label "status_open", "Open" %>
<%= f.radio_button :status, 'Open' %> <br />
<%= f.label "status_active", "Active" %>
<%= f.radio_button :status, 'Active' %> <br />
<%= f.label "status_closed", "Closed" %>
<%= f.radio_button :status, 'Closed' %> <br />
<%= f.label "status_matched", "Matched" %>
<%= f.radio_button :status, 'Matched' %> <br />
</div>
<%= f.submit "Submit", class: "btn btn-large btn-primary" %>
<% end %>
</div>
</div>
来源:
<div class="row">
<div class="span6 offset3">
<form accept-charset="UTF-8" action="/books" class="new_book" id="new_book" method="post"><div style="margin:0;padding:0;display:inline"></div>
<label for="book_title">Title</label>
<input id="book_title" name="book[title]" size="30" type="text" />
<label for="book_isbn">Isbn</label>
<input id="book_isbn" name="book[isbn]" size="30" type="text" />
<label for="book_edition">Edition</label>
<input id="book_edition" name="book[edition]" size="30" type="text" />
<label for="book_year">Year</label>
<input id="book_year" name="book[year]" size="30" type="text" />
<div style="display:inline">
<label for="book_book_category_fiction">Fiction</label>
<input id="book_category_fiction" name="book[category]" type="radio" value="Fiction" />
<label for="book_book_category_non_fiction">Non-fiction</label>
<input id="book_category_non-fiction" name="book[category]" type="radio" value="Non-fiction" />
</div>
<br />
<input class="btn btn-large btn-custom-black" name="commit" type="submit" value="Create Book" />
</form>
</div>
</div>
关于为什么按钮没有内联显示的任何想法?任何想法都非常感谢。