CSS: Change parent on focus of child

前端 未结 4 852
日久生厌
日久生厌 2020-12-13 01:43

Let\'s say you have something like:

<
4条回答
  •  执笔经年
    2020-12-13 02:11

    You can use pure CSS to make the text input look like it's not a text input unless it is in focus

    http://jsfiddle.net/michaelburtonray/C4bZ6/13/

    input[type="text"] {
        border-color: transparent;
        transition-duration: 600ms;
        cursor: pointer;
        outline-style: none;
        text-overflow: ellipsis;
    }
    
    input[type="text"]:focus {
        border-color: initial;
        cursor: auto;
        transition-duration: 300ms;
    }
    

提交回复
热议问题