如何设置重力形式段落文本元素的高度

use*_*024 1 css gravity-forms-plugin

我能够使用以下命令在 WP 入门主题 styles.css 的底部使用 CSS 设置边框颜色,但高度和行似乎不起作用 - 有人可以告诉我正确的语法(注意:我是使用 gf_right_half 作为 CSS 类名:

body #gform_wrapper_11 .gform_body .gform_fields #field_11_8.gfield textarea {
    border: 1px solid green;
    width: 100%;
    height: 5px !important;
    rows: 5 !important;
}
Run Code Online (Sandbox Code Playgroud)

san*_*rvh 5

我参加聚会有点晚了,但供将来参考:

在主题的functions.php中添加:

// Change textarea rows to 2 instead of 10
add_filter( 'gform_field_content', function ( $field_content, $field ) {
    if ( $field->type == 'textarea' ) {
        return str_replace( "rows='10'", "rows='2'", $field_content );
    } 
    return $field_content;
}, 10, 2 );
Run Code Online (Sandbox Code Playgroud)