Bootstrap select dropdown list placeholder

前端 未结 19 1252
谎友^
谎友^ 2021-01-29 22:39

I am trying to make a dropdown list that contains a placeholder. It doesn\'t seem to support placeholder=\"stuff\" as other forms do. Is there a different way to ob

19条回答
  •  遥遥无期
    2021-01-29 23:34

    Solution for Angular 2

    Create a label on top of the select

    
    
    

    and apply CSS to place it on top

    .hidden-label {
        position: absolute;
        margin-top: .34rem;
        margin-left: .56rem;
        font-style: italic;
        pointer-events: none;
    }
    

    pointer-events: none allows you to display the select when you click on the label, which is hidden when you select an option.

    angular html css

提交回复
热议问题