Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 如何在cakephp中内联放置文本框和按钮_Css_Forms_Cakephp - Fatal编程技术网

Css 如何在cakephp中内联放置文本框和按钮

Css 如何在cakephp中内联放置文本框和按钮,css,forms,cakephp,Css,Forms,Cakephp,为了便于搜索,我试图在默认布局页面的顶部内联显示文本框和提交按钮,但提交按钮却落在文本框下,搞乱了我的布局。我试过这个 echo $this->Form->create('Service', array( 'url' => array_merge(array('action' => 'search'), $this->params['pass']) )); echo $this->Form->input('serv

为了便于搜索,我试图在默认布局页面的顶部内联显示文本框和提交按钮,但提交按钮却落在文本框下,搞乱了我的布局。我试过这个

    echo $this->Form->create('Service', array(
        'url' => array_merge(array('action' => 'search'), $this->params['pass'])
    ));
    echo $this->Form->input('service_title', array('label' => false)).$this->Form->end(__('Find'));
我不知道这是否是一个css问题,但是正常的html标记显示得很好,那么Cake生成的“异常”html标记看起来如何。。。?我很确定蛋糕会生成普通的HTML

这是一个纯粹的CSS问题。

如果您需要为您的输入提供一个特定的类,您可以这样做:

$this->Form->input('some_field', array(
    'class' => 'some-class',
    'id' => 'some-specific-id'
));

然后根据您想要的样式编写CSS。

Cakephp添加额外的标记。。。对于内联输入和按钮,添加选项
div=>false
,如:

echo $this->Form->input('service_title', array('div' => false, 'label' => false, 'class' => 'myClassName'));
您可以在表单中为所有输入设置表单选项
inputDefaults
,如:

echo $this->Form->create('Service', array(
    'inputDefaults' => array(
        'label' => false,
        'div' => false
    )
));

然后,您不必为每个输入设置
div=>false
,请阅读有关表单的更多信息:

谢谢,我已经将代码放在div标记中,并假设它可以工作。。。Gues我今天过得很长那么到底是什么问题!?是否要修改div?css页面上的div标记格式不正确。。。所以这是一个css问题