- objective-c - iOS 5 : Can you override UIAppearance customisations in specific classes?
- iphone - 如何将 CGFontRef 转换为 UIFont?
- ios - 以编程方式关闭标记的信息窗口 google maps iOS
- ios - Xcode 5 - 尝试验证存档时出现 "No application records were found"
我有这种使用 Angular Material Select 的 html 结构
<mat-form-field class="year-drpdwn-vacay-stock">
<mat-select placeholder="Year">
<mat-option>None</mat-option>
<mat-option *ngFor="let yr of year" [value]="yr">{{yr}}</mat-option>
</mat-select>
</mat-form-field>
我放置了一个类,因为我在其他组件中也使用了Select。我尝试添加
::ng-deep .mat-select-panel {
margin-top: 20%;
}
在 CSS 中自定义,但问题是,其他包含另一个选择框的组件也会受到影响(继承 margin-top CSS)
目前我有这个CSS
.year-drpdwn-vacay-stock mat-select.mat-select :host ::ng-deep .mat-select-panel {
margin-top: 20%;
}
但是还是不行。
UPDATE
目标:我希望选项面板在打开选择框时向下移动一点,这就是为什么我希望 .mat-select-panel
的上边距为 20%
最佳答案
使用 cdk-overlay-container
作为基础,然后像这样转到选项 Pane ,mat-select 使用绝对位置,其中没有任何子项。所以你需要将你的样式应用到 cdk-overlay-container
.cdk-overlay-container .cdk-overlay-pane{
margin-top: 7%;
}
这是 demo
编辑:
好的,所以你有一个与你可以添加的其他元素的冲突问题
panelClass="testClass"
和
<mat-select placeholder="Favorite food" panelClass="testClass">
<mat-option *ngFor="let food of foods" [value]="food.value">
{{food.viewValue}}
</mat-option>
</mat-select>
然后像这样改变你的类(class)
.cdk-overlay-container .cdk-overlay-pane .testClass{
margin-top: 7%;
}
关于css - Angular Material Select : How to customize . mat-select-panel本身,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53699310/
这似乎是一个基本问题,但我已经尝试了一段时间并没有找到 Pyviz Panel 的解决方案: 我试图通过单击按钮来触发函数,捕捉函数的输出并将它们打印在屏幕上所需的位置。 with output ip
我正在尝试在销售订单屏幕上创建一个智能面板,它将显示与 SOLine 库存项目相关的项目。 我在库存项目页面上添加了一个选项卡和网格,并使用 CFBSUPSale 的 DAC 创建了一个表来创建此关系
需要这个: 但是得到这个: 我需要自定义绘制矩形来执行上述操作吗?另外我需要在面板内显示一个数字。有什么想法可以解决这个问题吗? 最佳答案 不要将第三个面板(水平面板)放在其他面板之一内。一旦所有三个
我正在使用 Ext JS 4.1.1 为网页创建 GUI。我尝试创建一个组件(下面的“GeneSearchComponent”),我可以在更复杂的布局中使用它。但出于某种原因,我无法将“GeneSea
我有这个面板。它按以下顺序显示工具图标:齿轮、关闭、折叠。我想得到的图标是这样的顺序:齿轮、折叠、关闭。我想不通。当我把 collapseFirst: true 放在第一位时,collapse 就在第
我正在使用 ExtJS 4.1.1a,我正在尝试为“tabbedPane”和带有“Accordion”布局的普通面板创建一个新主题。我无法更改每个标题的颜色。也就是说选项卡和选项卡的背景以及 Acco
根据MSDN - Panel.InternalChildren Property : Classes that are derived from Panel should use this prope
我有一个 Ext.Tab,Panel,我在其中动态创建了多个选项卡。 每个选项卡都包含一个 Ext.panel.panel。我需要做的是在选项卡中添加工具提示。我试图做这样的事情: Ext.defin
我有一个带有面板标题和面板主体的 Bootstrap v3 面板。我希望用户能够单击面板标题,它将折叠/展开面板主体。我正在使用 Bootstrap 的 Collapse javascript 来执行
我正在尝试在 ExtJS 中创建一个布局,它在顶部和底部的左右部分都有一个网格,一个基本的父/子、主/详细布局: wrapper_panel panel_top [grid] panel_bott
我正在使用 Extjs 6.0 开发网络 gis和 OpenLayers 3.6.0在 MVVM 架构中。我想把 ol.map到 Ext.panel.Panel .元素主视图如下: Ext.defin
我需要在 Python 中创建一个散布矩阵。我尝试使用 scatter_matrix 来实现此目的,但我只想保留对角线上方的散点图。 我正处于真正的开始阶段(没有走得太远),当列有名称(不是默认数字)
如果您在表单上创建一个面板并将其设置为 Dock=Top,然后放下另一个面板并设置其 Dock=Fill,它可能会填满整个表单,而忽略第一个面板。更改 Tab 键顺序没有任何作用。 最佳答案 停靠布局
我正在设计一个屏幕,其中标题有一个具有某些功能的按钮。为了实现这一点,我使用了 Ext.panel.Panel 现在我想在此屏幕中的标题下方添加列。这是我的代码: var screen = Ext.c
我有一个在 Ext.panel.Panel 上扩展的类。 简化代码: Ext.define("some.namespace.MyOwnPanel", { extends: "Ext.panel
在 Bootstrap 中,如何在单击另一个面板时使面板自动折叠,以便一次只打开一个面板?我不太擅长 JavaScript。 这里是一些示例代码: Information
我有一个主 JPanel,它实现了 Scrollable 并使用了 BorderLayout。它包含一个 NORTH 只读 JEditorPane、一个带有 FlowLayout 的 CENTER J
我正在用 wxPython 开发一个 GUI。我在另一个代表 CD 容器对象的正方形(也有 wxPanel 类)内绘制一个代表 CD 对象的正方形。我想在 CDWindow 的右键菜单中有“删除这张
我在第一个 div 中有两个字段集,然后我使用面板,但我的面板从 div 上方覆盖,请看下面的屏幕截图 1.) 带有文件集和详细信息2.) 添加面板后,Panel-heading to page 覆盖
我有一个 wx.Frame,其中有一个主 wx.Panel,里面有几个小部件。我想要那里的一个按钮导致出现“帮助面板”。这个帮助面板可能是一个 wx.Panel,我希望它覆盖整个主 wx.Panel(
我是一名优秀的程序员,十分优秀!