我正在使用带有 CakePHP 的选择列表和提交按钮,但我试图将它放在同一行但我无法弄清楚。我也试过把它们放在桌子上,但这也没有用。
这是表格
<div class="visits options">
<?php
echo $this->Form->create('Sort_Visits');
echo $this->Form->input('Sort', array('options' => $options));
echo $this->Form->end(__('Submit'));
?>
</div>
这是CSS
div.options {
float: left;
width:50%;
vertical-align: top;
}
这是输出
<div class="visits options">
<form action="/visits/index" id="Sort_VisitsIndexForm" method="post" accept-charset="utf-8"><div style="display:none;"><input type="hidden" name="_method" value="POST"/><input type="hidden" name="data[_Token][key]" value="233e6286a426dc782186142dde352208eddc8349" id="Token1459082309"/></div><div class="input select"><label for="Sort_VisitsSort">Sort</label><select name="data[Sort_Visits][Sort]" id="Sort_VisitsSort">
<option value="today">Today</option>
<option value="this_week">This Week</option>
<option value="filled">This Month</option>
<option value="not_filled">Previous Visits</option>
</select></div><div class="submit"><input type="submit" value="Submit"/></div><div style="display:none;"><input type="hidden" name="data[_Token][fields]" value="a17c91b362e9e635b23dfd139c314f081f977590%3A" id="TokenFields1535487420"/><input type="hidden" name="data[_Token][unlocked]" value="" id="TokenUnlocked1391584397"/></div></form>
</div>