简体   繁体   English

在yii2中更改工具提示大小

[英]Change tooltip size in yii2

i am using tooltip in yii2 ActiveForm on field and i could not figure that how to change the size and color of the tooltip 我使用的工具提示中yii2 ActiveFormfield ,我不能明白这如何改变工具提示的大小和颜色

I can not figure out which css class i should override to achieve it 我不知道我应该重写哪个CSS类来实现它

is it possible to change the size through jquery or any other way 是否可以通过jquery或其他任何方式更改大小

Here is my view file thank you 这是我的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>

Just override bootstrap.css with below code... 只需使用以下代码覆盖bootstrap.css ...

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM