Adding dollar prefix to bootstrap input box

后端 未结 4 1564
自闭症患者
自闭症患者 2020-12-13 04:01

Is there anyway bootstrap way/style to add non-editable prefix into the inputbox? such as the dollar sign. the prefix has to be included inside the input box.

curren

4条回答
  •  余生分开走
    2020-12-13 04:34

    HTML:

    $
    $

    CSS:

    .left-inner-addon {
        position: relative;
    }
    .left-inner-addon input {
        padding-left: 22px;    
    }
    .left-inner-addon span {
        position: absolute;
        padding: 7px 12px;
        pointer-events: none;
    }
    
    .right-inner-addon {
        position: relative;
    }
    .right-inner-addon input {
        padding-right: 30px;    
    }
    .right-inner-addon span {
        position: absolute;
        right: 0px;
        padding: 7px 12px;
        pointer-events: none;
    }
    

    jsFiddle

提交回复
热议问题