sách gpt4 ai đã đi

php - float 标签在 yii2 中不起作用

In lại 作者:行者123 更新时间:2023-11-28 15:43:29 25 4
mua khóa gpt4 Nike

我在 yii2 basic 中创建了一个表单,并使用 Material 设计来启用 float 标签,但是当我单击输入字段时,它的标签并没有 float 在上方。这是我的表单代码。

        $form = ActiveForm::begin([
'action' => ['index'],
'method' => 'get',
]);
?>









field($model, 'corporation_name',[ 'labelOptions' => [ 'class' => 'floating-label' ]])->textInput(['maxlength' => true, 'class' => 'form-control'])->label('Corporation Name') ?>



field($model, 'user_first_name',[ 'labelOptions' => [ 'class' => 'floating-label' ]])->textinput(['class' => 'form-control'])->label('Corporation Admin'); ?>





field($model, 'corporation_status')->dropDownList(Yii::$app->appstatues->status, ['prompt' => 'Status'])->label(false); ?>






'btn-primary btn waves-effect waves-light waves-effect']) ?>
'btn-primary btn waves-effect waves-light waves-effect', 'onclick' => 'location.href = "/admin/corporations";']) ?>









谁能告诉我我做错了什么?

1 Câu trả lời

你看过inspect元素了吗?

如果我理解你的话......

尝试移除输入表单周围的 div。当您为模型绑定(bind)表单时,您已经在输入周围设置了 div。试试这个...

field($model, 'ime',['options'=>['class'=>'form-group form-material floating', 'data-plugin'=> 'formMaterial'], 'labelOptions' => [ 'class' => 'floating-label' ]])->textInput(['maxlength' => true, 'class' => 'form-control'])->label('Corporation Name') ?> 

关于php - float 标签在 yii2 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43138902/

25 4 0
Bài viết được đề xuất: jQuery点击关闭div(显示)
Bài viết được đề xuất: swift - 使用 SnapKit 自动调整 UILabel 的大小
Bài viết được đề xuất: html - 如何保持标题与窗口大小相同
Bài viết được đề xuất: html - 将 HTML 表格复制到 Excel
行者123
Hồ sơ cá nhân

Tôi là một lập trình viên xuất sắc, rất giỏi!

Nhận phiếu giảm giá Didi Taxi miễn phí
Mã giảm giá Didi Taxi
Giấy chứng nhận ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com