如何给div添加placeholder属性

    xiaoxiao2021-11-29  22

    简单粗暴上代码:

    <!DOCTYPE <html> <head> <title></title> <style type="text/css"> .input{ width:200px; height:30px; border:1px solid grey; } .input:empty::before{ color:lightgrey; content:attr(placeholder); } </style> </head> <body> <div class="input" contenteditable placeholder="请输入文字"></div> </body> </html>

    转载请注明原文地址: https://ju.6miu.com/read-678586.html

    最新回复(0)