css - 样式化 p-selectButton
问题描述
我有一个 p-selectButton 标签,我需要编辑它的样式。这是我的 HTML 和 CSS 代码:
<p-selectButton class="pSelectButtonStyle" [options]="myTags" > </p-selectButton>
.pSelectButtonStyle {
border-top-left-radius: .3em;
border-top-right-radius: .3em;
border-bottom-left-radius: .3em;
border-bottom-right-radius: .3em;
border-left: solid #cccccc .07em;
border-right: solid #cccccc .07em;
}
解决方案
如果您使用的是第三方库,则无法在组件级别修改样式。所以在这里你需要将你的样式放在全局样式表中,即 style.css 文件,如下所示,使用p-selectButton
类选择器
html
<div class="my-container" >
<p-selectButton [options]="myTags" > </p-selectButton>
</div>
样式.css
.ui-buttonset:not(.ui-splitbutton) .ui-button {
border-top-left-radius: .3em;
border-top-right-radius: .3em;
border-bottom-left-radius: .3em;
border-bottom-right-radius: .3em;
border-left: solid #cccccc .07em;
border-right: solid #cccccc .07em;
background: white;
}
推荐阅读
- javascript - 单击第二个 li 时触发警报
- python - 在拉取请求上运行 python unittest(github 操作)
- docker - 通过像事件对象一样传递 API Gateway 在本地调用 Lambda docker 容器
- python - POST 方法不允许用于简单的查找网页
- java - 线程“主”core.ops.SignatureUnificationException 中的异常:找不到名为:ClassName 的类。找不到非主类
- html - 如何使 div 边框具有弹性但具有最小高度?
- android - 无法安装 @react-native-firebase/app 面向 compileDebugJavawithJavac FAILED
- python - 如何使用 for 循环压缩一系列 seaborn 散点图?
- c - 结构内的字符串 malloc 溢出
- macos - 鱼未知命令:__fish_pwd