代码之家  ›  专栏  ›  技术社区  ›  Asaf Abekasis

如何在css中检查p-drop prime ng是否已选择值

  •  0
  • Asaf Abekasis  · 技术社区  · 6 月前

    例如,p-inputext被p填充 p-dropdown应该有什么?不过,两者都很有针对性

     .p-inputtext:enabled.p-filled {
        border: 1px solid $twenty;
    }
    
    ::ng-deep .p-dropdown {
        background-color: initial;
        border: none;
        border-radius: 0%;
        border: solid 1px #ddd;
        min-width: 30rem;
        height: 5.5rem;
        width: 100%;
    } 
    
    1 回复  |  直到 6 月前
        1
  •  0
  •   Progromatic World    6 月前

    您更新的CSS 结合这些,你更新的CSS可能看起来像这样:

    ::ng-deep .p-dropdown {
        background-color: initial;
        border: none;
        border-radius: 0%;
        border: solid 1px #ddd;
        min-width: 30rem;
        height: 5.5rem;
        width: 100%;
    }
    
    ::ng-deep .p-dropdown:not(.p-dropdown-label-empty) .p-dropdown-label {
        border: 1px solid $twenty;
        background-color: #f0f8ff;
    }
    
    ::ng-deep .p-dropdown .p-dropdown-label.p-dropdown-label-empty {
        color: gray;
        font-style: italic;
    }
    
    ::ng-deep .p-dropdown:focus {
        outline: none;
        border: 1px solid blue;
    }