css - 更改内部类样式以溢出 : visible for specific class (For PrimeNG)

标签 css angular primeng

此问题特定于 PrimeNG 或 angular2 组件。他们的样式是隐藏的,但在他们提到的文档页面上,虽然很模糊。 这是网址:http://www.primefaces.org/primeng/#/dialog

如何改变组件的样式?

例如,对于 Dialog 组件,我们有 style 和 styleClass:

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

我们还有一个类 ui-dialog-content Content element .

现在我想将 ui-dialog-content 溢出样式更改为可见。我该怎么办?

这在文档中还不清楚。

我试过创建一个类

.dialog-overflow{
  overflow: visible;
}

并设置<p-dialog styleClass="dialog-overflow" ...但这显然不起作用,因为它不是正确的类 (ui-dialog-content)。

更新: 我也尝试过此选项但没有成功:

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

还有这个:

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

最佳答案

您可以使用已有的类:

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

但我相信你在这里犯了一个错误。该类不是使用 styleClass="abc" 设置的,而是使用 class="abc" 设置的。但我不太精通 Angular,所以我的知识基于 HTML。

因此您应该执行以下操作:

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

并使用您之前提供的 CSS:

.dialog-overflow{
    overflow: visible;
}

关于css - 更改内部类样式以溢出 : visible for specific class (For PrimeNG),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41698609/

相关文章:

javascript - 当跨度不包含内容时隐藏父级

javascript - Angular 等待变量初始化

angular - "required"p-calendar 验证器

typescript - Primeng - 对话服务将数据传递给对话组件

javascript - (重新安排)Codeigniter。如果它在侧边栏上,我应该在哪里/如何编写登录方法

javascript - 导航栏跳转问题

html - &lt;textarea&gt; 后简单 html 底部的空白

javascript - Angular - 将字符串变量的部分设为粗体

angular - 使用 Angular 14 Inject() 以及如何在测试中运行它

css - 我如何将 p-growl 元素放置在屏幕的右下角?