【网摘】模仿 placeholder 属性

 

/*为空时显示 element attribute content*/

.project-task-edit .subtask-body-txt:empty:before {
	content: attr(placeholder);
	color: #eee;
}

.project-task-edit .subtask-body-txt:not:empty:before {
	content: '';
	color: #eee;
}


/*焦点时内容为空*/

.subtask-body-txt:focus:before {
	content: none;
}

  

posted @ 2018-08-15 17:35  前端开发小姐姐  阅读(138)  评论(0)    收藏  举报