What does an empty value for the CSS property content do?

倖福魔咒の 提交于 2019-12-01 19:25:31
Mr. Alien

It's just a clearfix, which means, if your ul elements have floated li, than they will be self cleared, it just behaves similar to overflow: hidden; but unlike overflow: hidden; it wont hide the overflowing content.

Demo (Without clearfix)

Demo 2 (With clearfix)

And why you need to clear and what you need to clear, for that, you can refer my answer here


As you edited your question, content property is used with :before or :after pseudo to embed virtual content on the page, so using content: ""; means just blank, you are not embedding any character in your page.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!