博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[CSS] Target empty elements using the :empty pseudo-class
阅读量:6885 次
发布时间:2019-06-27

本文共 632 字,大约阅读时间需要 2 分钟。

You can target an element that has no child elements by using the :empty pseudo-class. With browser support down to IE9, it's solid, easy way to select empty elements without any additional markup.

Be aware that whitespace is considered a "child", so :empty will not work if the element has no children, but has space between the opening and closing tags.

 

  

Success! Your profile has been updated.

.Alert:not(:empty) {
border: 3px solid darkgreen; margin: 1em; padding: 1em; background-color: seagreen; color: white; border-radius: 4px;}.Alert:empty{
display:none;}

 

转载地址:http://danbl.baihongyu.com/

你可能感兴趣的文章
Linux20180421五周第二次课(4月19日)
查看>>
EYOU 文章列表如何调用自定义字段
查看>>
http请求头,响应头字段
查看>>
tomcat下web.xml文件修改后工程重启的原因
查看>>
学习大数据掌握这几个方法可轻松入门
查看>>
资源的有限性与任务的复杂性之间的矛盾
查看>>
Java动态规划策略原理及例题
查看>>
Socket一般步骤
查看>>
微信小程序斩获世界大奖后,中小企业怎样搭上这辆快速列车?
查看>>
10大Python开源项目推荐
查看>>
PDF转Word的简单方法
查看>>
提升机器学习数学基础,这7本书一定要读-附pdf资源
查看>>
25G与100G以太网光模块解决方案
查看>>
社交网络犯罪金额超30亿
查看>>
ngx_lua_module开发(2012-11-16 23:46)
查看>>
如何用Java实现.NET中DataTable功能
查看>>
【13】线程间的信号处理
查看>>
linux yum软件包管理器
查看>>
Linux学习笔记<二十九>——http服务
查看>>
VMware虚拟机克隆CentOS6.4网卡无法正常启动解决案例
查看>>