我想在ajaxsubmitbutton中添加fontawesome图标,
<?php echo CHtml::ajaxSubmitButton('<i class="fa fa-plus"></i> Print Preview',
array('ma/select'),
array( 'success'=>'reloadGrid',
'error'=>'js:function(data){
alert("Please select checkbox");
return false;
}'),
array( //'encodeLabel'=>false,
'class'=>'btn btn-success',
)); ?>
我已经尝试将encodeLabel设置为false,然后尝试将encodeLabel设置为false,所有这些都不起作用,
有人知道如何处理吗???谢谢你
你为什么用encodeLabel
?问题在于FontAwesome样式表使用before
伪元素添加图标。
:after
和:before
伪元素,它们只能放在容器元素上。为什么?因为它们是附加在该特定元素内的。input
不是容器。button
例如,因此您可以戴上它们。
echo CHtml::ajaxSubmitButton( ' Print Preview ', $url, array(),
array('encode'=>false)
)
在CSS中是这样的:
input[type="submit"] {
font-family: FontAwesome, 'Ubuntu', sans-serif;
}
有关更多参考,请检查以下内容:如何在输入字段中添加“真棒字体”图标?
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句