gpt4 book ai didi

css - 在 Drupal 7 表单 API 中使用 CSS 类

转载 作者:行者123 更新时间:2023-11-28 12:04:28 25 4
gpt4 key购买 nike

我在表单中定义了一个复选框:

$form['membership_block']['membership_info_is_verified'] = array(
'#type' => 'checkbox',
'#title' => t('<strong>I confirm my information is correct.</strong>'),
'#description' => t('Select the checkbox here to confirm your information is correct, then be sure to <strong>click the Save button</strong> below to save your change.'),
);

我希望标题和描述被一个浅绿色背景的框包围。我一直无法弄清楚如何指定它。

最佳答案

表单元素可以有(可选)元素“#prefix”和“#suffix”。

$form['membership_block']['membership_info_is_verified'] = array(
'#prefix' => '<div class="green_background">',
'#suffix' => '</div>',
// ...
);

这样您就可以用附加代码包围 Form 元素的 HTML 代码。

关于css - 在 Drupal 7 表单 API 中使用 CSS 类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19753534/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com