【发布时间】:2009-12-30 05:01:28
【问题描述】:
我有一个登录表单,用户(尚未登录)可以在其中插入他的登录名和密码,填写完这些字段后,用户必须按下提交按钮。
我想要做的是:用一些 css 样式替换 $html->链接的正常提交按钮。
那么有没有我可以使用这样的东西:
<span class = "licitateThis clearfix">
<?php echo $html->link(__("Sign In", true), array("type" => "Sign In", 'class'=>'licitate')); ?>
</span>
代替:
echo $form->end(__('Sign In',true));
为小型登录表单创建提交按钮?
我的css代码:
.licitateThis{position:relative;float:left;width:100%;}
.licitateThis a.licitate{display:block;float:left;padding:2px 0 4px;width:100%;background-color:#eee;text-shadow:#fff 1px 1px 1px;text-decoration:none;font-weight:bold;font-size:115%;border:1px solid #fff;border-radius:3px;text-align:center;letter-spacing:-0.02em;text-transform:uppercase;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;}
.licitateThis a.licitate:hover,.licitateThis:hover a{background-color:#0071bb;text-shadow:#666 1px 1px 1px;color:#fff;}
PS: 我尝试提交的表单是一个登录表单,它位于 default.ctp,因此可以在每个页面中使用。
问题已解决:
CSS(创建了一个新类):
.loginSubmit {color:#0071bb;outline:none; display:block;float:left;padding:2px 0 4px;width:100%;background-color:#eee;text-shadow:#fff 1px 1px 1px;text-decoration:none;font-weight:bold;font-size:115%;border:1px solid #fff;border-radius:3px;text-align:center;letter-spacing:-0.02em;text-transform:uppercase;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;}
.loginSubmit:hover {background-color:#0071bb;text-shadow:#666 1px 1px 1px;color:#fff;}
PHP:
<button type="submit" class="loginSubmit">Sign In</button>
<?php echo $form->end(); ?>
谢谢。
【问题讨论】: