给非input元素增加placeholder特性

如下图

 有子控件时

 

 

 想要实现如果明细中没有子控件时显示可添加多个子控件

.simplaceholder{
    width:100px;
    height:30px;
    margin: 10px auto;
}
.simplaceholder:empty:after{
    content: attr(placeholder);
    color:darkgray;
}
<div class='simplaceholder' placeholder='可添加多个子控件'></div>

 

posted @ 2020-02-12 10:47  zhaogaojian  阅读(295)  评论(0编辑  收藏  举报