【问题标题】:Zend Framework Form Submit Button StyleZend Framework 表单提交按钮样式
【发布时间】:2013-02-15 15:01:15
【问题描述】:

是否可以从默认更改表单的提交按钮 - 就像 Gmail 按钮说的那样,它是蓝色的? 目前我的表单中有这个:

$this->addElement('submit', 'form_element_signup', array('label' => 'Sign up',
                                                                 'tabindex' => 20,
                                                                 'decorators' => array('ViewHelper',
                                                                                        array(array('div' => 'HtmlTag'),
                                                                                               array ('tag' => 'button',
                                                                                                      'class' => 'action blue')))));

但这仍然给了我 div 按钮中的默认提交按钮。

【问题讨论】:

    标签: forms zend-framework button zend-form form-submit


    【解决方案1】:

    您可以使用自己的 css 属性添加自定义类,如下所示

    $this->addElement(new Zend_Form_Element_Button( 'send',
                       array( 'label' => 'registrieren', 
                              'class' => 'button-red', 
                              'type' => 'submit',
                              'escape' => false,
                              'required' => false,
                               'ignore' => false, ) ));
    

    【讨论】:

      【解决方案2】:

      是的,只需根据需要将适当的 CSS 应用于“div”、“tag”或“class”。 22 CSS Button Styling Tutorials and Techniques 可能会有所帮助。

      【讨论】:

        猜你喜欢
        • 2013-09-10
        • 2015-09-06
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-06-30
        • 1970-01-01
        • 2016-01-06
        相关资源
        最近更新 更多