Yii2 Form表单样式修改
2015-10-20 09:16
603 查看
以下为主要的样式修改的代码,大家可以看着修改。如需要修改类而不是样式,只需要替换style为class即可。
<?php $form = ActiveForm::begin(['action' => ['site/login'], 'method' => 'post']);?> <div style='width:255px;min-height:40px;height:auto;'> <label for='loginform-username' style='margin-right:10px;line-height:2.2em;float:left;'>用户名</label> <?= $form->field($model, 'username') ->label(false) ->textInput(['style' => 'float:left;width:200px;']) ->error(['style' => 'line-height:2.2em;']); ?> </div> <div style='width:255px;min-height:40px;height:auto'> <label for='loginform-username' style='padding-left:13px;margin-right:10px;line-height:2.2em;float:left;'>密码</label> <?= $form->field($model, 'password') ->passwordInput() ->label(false) ->textInput(['style' => 'float:left;width:200px;']) ->error(['style' => 'line-height:2.2em;']); ?> </div> <div style='width:255px;min-height:20px;height:auto'> <?= $form->field($model, 'rememberMe') ->checkBox(['style' => 'flot:left;']) ->label('请记住我', ['style' => 'margin-right:-35px;']); ?> </div> <?= Html::submitButton('登录', ['class' => 'btn btn-primary', 'name' => 'submit-button']); ?>
相关文章推荐
- 华为三层交换机STP配置
- PHP中如何使用session实现保存用户登录信息
- php json中文乱码问题
- 烂泥:ubuntu下配置msmtp+mutt发送邮件
- 烂泥:ubuntu下配置msmtp+mutt发送邮件
- PHP的语言结构和函数的区别
- php大力力:技术排错过程中,关键点总结和心情历程(2015-10-19)
- PHP 页面抓取技术
- Laravel安装
- PHP中如何使用session实现保存用户登录信息
- php上传大文件失败的原因及应对策略
- PHP判断上传文件类型的解决办法
- php文件上传你必须知道的几点
- php生成验证码函数
- php根据日期或时间戳获取星座信息和生肖等信息
- php获取远程文件大小
- php限制文件下载速度的代码
- PHP页面转UTF-8中文编码乱码的解决办法
- php的mail函数发送UTF-8编码中文邮件时标题乱码的解决办法
- 【原创】PHP超时处理全面总结