Styling placeholder on Firefox

后端 未结 2 1814
情书的邮戳
情书的邮戳 2021-01-14 13:40

What I want to do is to make a placeholder appear on the center 50% top and 50% left. It appears to be good in Chrome but not on Firefox 23. I have an example here.

2条回答
  •  借酒劲吻你
    2021-01-14 14:38

    Use padding in your css instead of giving positions:

    textarea::-moz-placeholder {
     position: relative;
     font-size: 16px;
     font-style: italic;
     color: #ABABAB;
     padding-top: 50px;
     padding-left:50px;
     text-align: center;
    }
    
    textarea::-webkit-input-placeholder {
    position: relative;
    font-size: 16px;
    font-style: italic;
    color: #ABABAB;
    padding-top: 50px;
    padding-left:50px;
    text-align: center;
    }
    

    you can adjust the padding according to the need.

提交回复
热议问题