ng bootstrap工具提示的宽度和背景色 [英] Width and background color of ng bootstrap tooltip

查看:91
本文介绍了ng bootstrap工具提示的宽度和背景色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我还需要修改工具提示框的宽度及其背景.我该如何实现?我正在使用angular2和ng bootstrap.

I need to modify the width of the tooltip box and the background of it too. How can I achieve it? I am using angular2 and ng bootstrap.

<i class="fa fa-info-circle info-icon-background" [ngbTooltip]="tooltipContent" aria-hidden="true" ></i>

我尝试将以下内容放入"task-modal.component.css" css文件中,但似乎不起作用.请帮忙.

I have tried putting the following in my "task-modal.component.css" css file but it does not seem to work. Please help.

.tooltip-inner{
  width: 400px;
  background-color: #FFFFFF;
}

在我的角度组件中,我将css文件指定为:

In my angular component, I specify the css file as:

@Component({
  selector: 'task-modal',
  templateUrl: './task-modal.component.html',
  styleUrls: ['task-modal.component.css'],
  providers: [TasksService]
})

推荐答案

将此添加到您的css文件中,在您的情况下 task-modal.component.css

add this in your css file, in your case task-modal.component.css,

角度2:

/deep/ .tooltip-inner {
 width: 400px;
 background-color: #FFFFFF;
}

Angular 4.3.0

Angular 4.3.0

/deep/ Angular 4.3.0中已弃用,现在首选:: ng-deep,

/deep/ was deprecated in Angular 4.3.0 and ::ng-deep is now preferred,

::ng-deep .tooltip-inner {
     width: 400px;
     background-color: #FFFFFF;
}

这篇关于ng bootstrap工具提示的宽度和背景色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆