gpt4 book ai didi

javascript - 在 yii2 中更改工具提示大小

转载 作者:行者123 更新时间:2023-11-29 21:42:00 25 4
gpt4 key购买 nike

我在 field 的 yii2 ActiveForm 中使用工具提示,我不知道如何更改工具提示的大小和颜色

我不知道我应该覆盖哪个 css 类来实现它

是否可以通过jquery或任何其他方式改变大小

这是我的 View 文件谢谢

<script>
$(function() {
$( "[title]" ).tooltip();
});
</script>

<div class="site-signup">
<h1><?= Html::encode($this->title) ?></h1>

<div class="row">
<div class="col-lg-5">
<?php $form = ActiveForm::begin(['options'=>['enctype'=>'multipart/form-data']]); ?>

<?= $form->field($model, 'username')->textInput( ['data-toggle' => 'tooltip',
'data-placement' =>
'right',
'title' => 'Username should contain at least 6 characters'
]) ?>

<?= $form->field($model, 'password')->passwordInput()->textInput( ['data-toggle' => 'tooltip',
'data-placement' => 'right',
'title' => 'Password should contain at least 6 characters'
]) ?>

<div class="form-group">
<?= Html::submitButton('Signup', ['class' => 'btn btn-primary', 'name' => 'signup-button']) ?>
</div>

<?php ActiveForm::end(); ?>
</div>
</div>

最佳答案

只需用下面的代码覆盖 bootstrap.css...

.tooltip-inner {
max-width: 350px;
/* If max-width does not work, try using width instead */
width: 350px;
}

关于javascript - 在 yii2 中更改工具提示大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32473472/

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