简体   繁体   English

将内部类样式更改为溢​​出:对于特定类可见(对于PrimeNG)

[英]change internal class style to overflow: visible for specific class (For PrimeNG)

This question is specific to PrimeNG or angular2 components. 此问题特定于PrimeNG或angular2组件。 Their styles are hidden but on documentation page they mention, although quite vaguely. 它们的样式是隐藏的,但是在文档页面上却提到了它们,尽管有些模糊。 Here is url: http://www.primefaces.org/primeng/#/dialog 这是网址: http : //www.primefaces.org/primeng/#/dialog

How could one change styles of a component? 一个如何改变组件的样式?

For example for Dialog component we have style and styleClass: 例如,对于Dialog组件,我们有style和styleClass:

style       string  null    Inline style of the component.
styleClass  string  null    Style class of the component.

Also we have a class ui-dialog-content Content element . 我们还有一个ui-dialog-content Content element

Now I want to change for ui-dialog-content overflow style to visible. 现在,我想将ui-dialog-content溢出样式更改为可见。 What should I do? 我该怎么办?

This is quite unclear from documentation. 从文档中还不清楚。

I have tried create a class 我试过创建一个类

.dialog-overflow{
  overflow: visible;
}

and set <p-dialog styleClass="dialog-overflow" ... but that obviously does not work as it is not correct class (ui-dialog-content). 并设置<p-dialog styleClass="dialog-overflow" ...但这显然不起作用,因为它不是正确的类(ui-dialog-content)。

Update: I have tried with no success this option also: 更新:我也尝试了这个选项,但没有成功:

.dialog-overflow .ui-dialog-content {
  overflow: visible;
}    

and this: 和这个:

.dialog-overflow >>> .ui-dialog-content {
  overflow: visible;
}    

You can use the class you already have: 您可以使用已有的类:

.ui-dialog-content {
    overflow: visible;
}

But I believe you are making a mistake here. 但我相信您在这里犯了一个错误。 The class is not set using styleClass="abc" but using class="abc" . 该类不是使用styleClass="abc"而是使用class="abc" But I'm not overly proficient in angular, so I'm basing my knowledge on HTML. 但是我并不擅长于角度,所以我将自己的知识基于HTML。

So you should do the following: 因此,您应该执行以下操作:

<p-dialog class="dialog-overflow"></p-dialog>

And use the CSS you provided before: 并使用之前提供的CSS:

.dialog-overflow{
    overflow: visible;
}

Actually, this was solution. 实际上,这是解决方案。

p-dialog >>> .ui-dialog-content {
  overflow: visible;
}    

p-dialog >>> .ui-dialog{
  overflow: visible;
}    

Double overflow for this component to go through two nested divs. 该组件的两次溢出要经过两个嵌套的div。

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

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